mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-28 10:53:11 +01:00
changed UserSerializer to utilize custom user classes (didn't work with them before)
This commit is contained in:
parent
2b6ad7a2cf
commit
60aae680dd
@ -2,7 +2,7 @@ from .forms import TicketForm
|
|||||||
from .lib import format_time_spent, process_attachments
|
from .lib import format_time_spent, process_attachments
|
||||||
from .models import CustomField, FollowUp, FollowUpAttachment, Ticket
|
from .models import CustomField, FollowUp, FollowUpAttachment, Ticket
|
||||||
from .user import HelpdeskUser
|
from .user import HelpdeskUser
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth import get_user_model
|
||||||
from django.contrib.humanize.templatetags import humanize
|
from django.contrib.humanize.templatetags import humanize
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.exceptions import ValidationError
|
from rest_framework.exceptions import ValidationError
|
||||||
@ -152,7 +152,7 @@ class UserSerializer(serializers.ModelSerializer):
|
|||||||
password = serializers.CharField(write_only=True)
|
password = serializers.CharField(write_only=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = get_user_model()
|
||||||
fields = ('first_name', 'last_name', 'username', 'email', 'password')
|
fields = ('first_name', 'last_name', 'username', 'email', 'password')
|
||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
|
Loading…
Reference in New Issue
Block a user