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
d5d45c1f
Commit
d5d45c1f
authored
Oct 11, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed check flags validation
parent
d5e31a98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
trans/validators.py
trans/validators.py
+10
-2
No files found.
trans/validators.py
View file @
d5d45c1f
...
...
@@ -19,9 +19,14 @@
#
from
django.core.exceptions
import
ValidationError
from
django.utils.translation
import
ugettext
as
_
from
trans.checks
import
CHECKS
VALID_FLAGS
=
(
'rst-text'
,
'python-format'
,
'c-format'
,
'php-format'
,
'python-brace-format'
,
)
...
...
@@ -110,5 +115,8 @@ def validate_check_flags(val):
Validates check influencing flags.
'''
for
flag
in
val
.
split
(
','
):
if
flag
not
in
VALID_FLAGS
:
raise
ValidationError
(
_
(
'Invalid check flag: "%s"'
)
%
flag
)
if
flag
in
VALID_FLAGS
:
continue
if
flag
.
startswith
(
'ignore-'
)
and
flag
[
7
:]
in
CHECKS
:
continue
raise
ValidationError
(
_
(
'Invalid check flag: "%s"'
)
%
flag
)
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