Commit 0b481654f07e67efc5b979d9e78741a278484f46
1 parent
9ea23b85
Exists in
master
and in
33 other branches
Updated form msg and used reverse link
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
colab/accounts/forms.py
... | ... | @@ -3,10 +3,12 @@ |
3 | 3 | from collections import OrderedDict |
4 | 4 | |
5 | 5 | from django import forms |
6 | +from django.conf import settings | |
6 | 7 | from django.contrib.auth import authenticate, get_user_model |
7 | 8 | from django.contrib.auth.forms import ReadOnlyPasswordHashField |
8 | 9 | from django.contrib.auth.tokens import default_token_generator |
9 | 10 | from django.contrib.sites.shortcuts import get_current_site |
11 | +from django.core.urlresolvers import reverse | |
10 | 12 | from django.template import loader |
11 | 13 | from django.utils.encoding import force_bytes |
12 | 14 | from django.utils.http import urlsafe_base64_encode |
... | ... | @@ -16,7 +18,6 @@ from django.utils.safestring import mark_safe |
16 | 18 | |
17 | 19 | from conversejs.models import XMPPAccount |
18 | 20 | |
19 | -from django.conf import settings | |
20 | 21 | |
21 | 22 | from .utils.validators import validate_social_account |
22 | 23 | from .utils import mailman |
... | ... | @@ -67,8 +68,10 @@ class UserForm(forms.ModelForm): |
67 | 68 | user_qs = User.objects.filter(email=email).exclude(username=username) |
68 | 69 | |
69 | 70 | if email and user_qs.exists(): |
70 | - msg = mark_safe("Try login in: <a href='login'>sign in<a/>") | |
71 | - raise forms.ValidationError(msg) | |
71 | + url = reverse('login') | |
72 | + msg = ("Email already used. Is it you?" | |
73 | + " Please <a href='{}'>login<a/>").format(url) | |
74 | + raise forms.ValidationError(mark_safe(msg)) | |
72 | 75 | |
73 | 76 | return email |
74 | 77 | ... | ... |