Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translated registration error messages #261

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions user/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def validate_email(self, email):
email = get_adapter().clean_email(email)
if email and EmailAddress.objects.filter(email__iexact=email).exists():
raise serializers.ValidationError(
"Používateľ s danou emailovou adresou už existuje.")
"Entered email adress is already used! Please try again with another email adress.")
return email

def validate_password1(self, password):
Expand All @@ -189,18 +189,18 @@ def validate_profile(self, profile):
'''
if not profile['gdpr']:
raise serializers.ValidationError(
'Musíš podvrdiť, že si si vedomý spracovania osobných údajov.')
'You have to confirm, that you are aware of the processing of personal data.')
return profile

def validate(self, attrs):
if attrs['password1'] != attrs['password2']:
raise serializers.ValidationError("Zadané heslá sa nezhodujú.")
raise serializers.ValidationError("Entered passwords do not match.")

# ak je zadana skola "ina skola", musi byt nejaky description skoly
if (attrs['profile']['school'].code == self.OTHER_SCHOOL_CODE and
len(attrs['new_school_description']) == 0):
raise serializers.ValidationError(
'Musíš zadať popis tvojej školy.')
'You must enter a description of your school.')

return attrs

Expand Down
Loading