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
be5765f9
Commit
be5765f9
authored
Sep 01, 2015
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
831ff127
472d5440
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
5 deletions
+32
-5
weblate/accounts/pipeline.py
weblate/accounts/pipeline.py
+20
-2
weblate/settings_example.py
weblate/settings_example.py
+1
-0
weblate/trans/checks/same.py
weblate/trans/checks/same.py
+6
-1
weblate/trans/forms.py
weblate/trans/forms.py
+5
-2
No files found.
weblate/accounts/pipeline.py
View file @
be5765f9
...
...
@@ -20,12 +20,16 @@
from
django.shortcuts
import
redirect
from
django.core.urlresolvers
import
reverse
from
django.contrib.auth.models
import
User
from
django.utils.translation
import
ugettext
as
_
import
urllib2
import
json
from
social.pipeline.partial
import
partial
from
social.exceptions
import
AuthForbidden
,
AuthMissingParameter
from
social.exceptions
import
(
AuthException
,
AuthMissingParameter
,
AuthAlreadyAssociated
)
from
weblate.accounts.models
import
send_notification_email
,
VerifiedEmail
from
weblate
import
appsettings
...
...
@@ -118,7 +122,21 @@ def verify_open(strategy, backend, user=None, **kwargs):
'''
if
not
user
and
not
appsettings
.
REGISTRATION_OPEN
:
raise
AuthForbidden
(
backend
)
raise
AuthException
(
backend
,
_
(
'New registrations are disabled!'
))
def
verify_username
(
strategy
,
backend
,
user
,
social
,
details
,
**
kwargs
):
"""Verified whether username is still free.
It can happen that user has registered several times or other user has
taken the username meanwhile.
"""
if
not
user
and
'username'
in
details
:
if
User
.
objects
.
filter
(
username__iexact
=
details
[
'username'
]).
exists
():
raise
AuthAlreadyAssociated
(
backend
,
_
(
'This username is already taken. Please choose another.'
)
)
def
store_email
(
strategy
,
backend
,
user
,
social
,
details
,
**
kwargs
):
...
...
weblate/settings_example.py
View file @
be5765f9
...
...
@@ -224,6 +224,7 @@ SOCIAL_AUTH_PIPELINE = (
'social.pipeline.mail.mail_validation'
,
'social.pipeline.social_auth.associate_by_email'
,
'weblate.accounts.pipeline.verify_open'
,
'weblate.accounts.pipeline.verify_username'
,
'social.pipeline.user.create_user'
,
'social.pipeline.social_auth.associate_user'
,
'social.pipeline.social_auth.load_extra_data'
,
...
...
weblate/trans/checks/same.py
View file @
be5765f9
...
...
@@ -197,6 +197,7 @@ SAME_BLACKLIST = frozenset((
'expert'
,
'explore'
,
'export'
,
'expression'
,
'extension'
,
'extra'
,
'extras'
,
...
...
@@ -397,6 +398,7 @@ SAME_BLACKLIST = frozenset((
'message'
,
'messages'
,
'meta'
,
'metadata'
,
'metal'
,
'metre'
,
'metres'
,
...
...
@@ -476,6 +478,8 @@ SAME_BLACKLIST = frozenset((
'park'
,
'parking'
,
'partition'
,
'partitions'
,
'parser'
,
'party'
,
'password'
,
'pause'
,
...
...
@@ -1131,7 +1135,8 @@ class SameCheck(TargetCheck):
def check_single(self, source, target, unit, cache_slot):
# English variants will have most things not translated
if self.is_language(unit, ('en', )):
# Interlingua is also quite often similar to English
if self.is_language(unit, ('en', 'ia')):
return False
# One letter things are usually labels or decimal/thousand separators
...
...
weblate/trans/forms.py
View file @
be5765f9
...
...
@@ -760,13 +760,16 @@ class CheckFlagsForm(forms.Form):
flags
=
forms
.
CharField
(
label
=
_
(
'Check flags'
),
required
=
False
,
help_text
=
_
(
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
CheckFlagsForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
fields
[
'flags'
].
help_text
=
ugettext
(
'Please enter a comma separated list of check flags, '
'see <a href="{url}">documentation</a> for more details.'
).
format
(
url
=
weblate
.
get_doc_url
(
'admin/checks'
,
'custom-checks'
)
)
)
def
clean_flags
(
self
):
"""
...
...
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