Allow updating emails
This commit is contained in:
parent
3ff81633a7
commit
f937dfdbce
|
@ -2,6 +2,7 @@ from django.contrib.auth.models import User, Group
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.exceptions import ValidationError
|
from rest_framework.exceptions import ValidationError
|
||||||
from rest_auth.registration.serializers import RegisterSerializer
|
from rest_auth.registration.serializers import RegisterSerializer
|
||||||
|
from rest_auth.serializers import UserDetailsSerializer
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
@ -48,6 +49,11 @@ class UserTrainingSerializer(serializers.ModelSerializer):
|
||||||
exclude = ['user']
|
exclude = ['user']
|
||||||
depth = 2
|
depth = 2
|
||||||
|
|
||||||
|
class UserDetailsSerializer(UserDetailsSerializer):
|
||||||
|
class Meta:
|
||||||
|
model = User
|
||||||
|
fields = ['username', 'email']
|
||||||
|
|
||||||
class UserSerializer(serializers.ModelSerializer):
|
class UserSerializer(serializers.ModelSerializer):
|
||||||
training = UserTrainingSerializer(many=True)
|
training = UserTrainingSerializer(many=True)
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,10 @@ REST_FRAMEWORK = {
|
||||||
'DEFAULT_AUTHENTICATION_CLASSES': DEFAULT_AUTHENTICATION_CLASSES,
|
'DEFAULT_AUTHENTICATION_CLASSES': DEFAULT_AUTHENTICATION_CLASSES,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REST_AUTH_SERIALIZERS = {
|
||||||
|
'USER_DETAILS_SERIALIZER': 'apiserver.api.serializers.UserDetailsSerializer'
|
||||||
|
}
|
||||||
|
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'formatters': {
|
'formatters': {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user