Skip to content

Commit

Permalink
Merge pull request #22 from AUTGamecraft/excel
Browse files Browse the repository at this point in the history
Excel
  • Loading branch information
Javad-Ak authored Sep 16, 2024
2 parents f51ada2 + afe8553 commit fb41f27
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions user/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ def export_selected_class_participants(self, request, queryset):
'is_staff'
)

exclude = None
fields = None

add_fieldsets = (
(
None,
{
"classes": ("wide",),
"fields": ("user_name", "password1", "password2"),
},
),
)

# field set
fieldsets = (
(None, {'fields': ('email', 'user_name', 'first_name', 'password')}),
Expand Down
7 changes: 6 additions & 1 deletion user/serializers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from copy import deepcopy

from rest_framework import serializers

from django.contrib.auth import get_user_model
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer

from .models import (
PhoneValidator,
Expand Down Expand Up @@ -54,6 +57,7 @@ class Meta:
class TeamSerialzer(serializers.ModelSerializer):
def get_state(self, obj):
return obj.get_state_display()

state = serializers.SerializerMethodField()
emails = serializers.ListField(
write_only=True, child=serializers.EmailField())
Expand All @@ -72,7 +76,8 @@ def create(self, validated_data):
team = Team.objects.create(**val)
team.save()
return team



class UserSerializerMinimal(serializers.ModelSerializer):
class Meta:
model = SiteUser
Expand Down

0 comments on commit fb41f27

Please sign in to comment.