Improved user registration serializer

This commit is contained in:
Keannu Bernasol 2023-07-19 02:38:35 +08:00
parent bf9ed11a9e
commit 3748b4d2c8
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -19,7 +19,7 @@
<p>{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}</p>
<p>{% trans "Please go to the following page to activate your account in-app:" %}</p>
<p><a href="{{ domain }}://{{ url|safe }}">{{ domain }}://--/{{ url|safe }}</a></p>
<p><a href="{{domain}}://{{url}}">{{ domain }}://{{url}}</a></p>
<p>{% blocktrans %}Many thanks from the {{ site_name }} team{% endblocktrans %}</p>