Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
bca79a5e
Commit
bca79a5e
authored
Oct 10, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
ede6b5db
994bb972
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
accounts/forms.py
accounts/forms.py
+11
-9
accounts/tests.py
accounts/tests.py
+1
-0
No files found.
accounts/forms.py
View file @
bca79a5e
...
...
@@ -79,6 +79,7 @@ class UsernameField(forms.RegexField):
'
numbers
and
following
characters
:
@
.
+
-
_
'
)
}
kwargs['
required
'] = True
self.valid = None
super(UsernameField, self).__init__(*args, **kwargs)
...
...
@@ -87,16 +88,17 @@ class UsernameField(forms.RegexField):
'''
Username validation, requires length of five chars and unique.
'''
existing = User.objects.filter(
username__iexact=value
)
if existing.exists() and value != self.valid:
raise forms.ValidationError(
_(
'
This
username
is
already
taken
.
'
'
Please
choose
another
.
'
)
if value is not None:
existing = User.objects.filter(
username__iexact=value
)
if existing.exists() and value != self.valid:
raise forms.ValidationError(
_(
'
This
username
is
already
taken
.
'
'
Please
choose
another
.
'
)
)
return super(UsernameField, self).clean(value)
...
...
accounts/tests.py
View file @
bca79a5e
...
...
@@ -293,6 +293,7 @@ class ProfileTest(ViewTestCase):
'first_name'
:
'First'
,
'last_name'
:
'Last'
,
'email'
:
'noreply@weblate.org'
,
'username'
:
'testik'
,
}
)
self
.
assertRedirects
(
response
,
reverse
(
'profile'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment