From 3748b4d2c881289d8b3d62452194e71cb016c3d6 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Wed, 19 Jul 2023 02:38:35 +0800 Subject: [PATCH] Improved user registration serializer --- stude/accounts/serializers.py | 2 ++ stude/templates/email_activation/email_activation.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/stude/accounts/serializers.py b/stude/accounts/serializers.py index f9349e2..a8b9dad 100644 --- a/stude/accounts/serializers.py +++ b/stude/accounts/serializers.py @@ -83,6 +83,8 @@ class UserRegistrationSerializer(serializers.ModelSerializer): student_id_number = serializers.CharField(required=True) password = serializers.CharField( write_only=True, style={'input_type': 'password', 'placeholder': 'Password'}) + subjects = serializers.SlugRelatedField( + many=True, slug_field='name', queryset=Subject.objects.all(), required=False, allow_null=True) class Meta: model = CustomUser # Use your custom user model here diff --git a/stude/templates/email_activation/email_activation.html b/stude/templates/email_activation/email_activation.html index 03321f8..d628f3a 100644 --- a/stude/templates/email_activation/email_activation.html +++ b/stude/templates/email_activation/email_activation.html @@ -19,7 +19,7 @@

{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}

{% trans "Please go to the following page to activate your account in-app:" %}

-

{{ domain }}://--/{{ url|safe }}

+

{{ domain }}://{{url}}

{% blocktrans %}Many thanks from the {{ site_name }} team{% endblocktrans %}