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
3077a105
Commit
3077a105
authored
Oct 07, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0d02f62d
13356b81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
trans/tests/models.py
trans/tests/models.py
+20
-0
trans/validators.py
trans/validators.py
+7
-2
No files found.
trans/tests/models.py
View file @
3077a105
...
...
@@ -422,6 +422,26 @@ class SubProjectTest(RepoTestCase):
project
.
full_clean
)
# Bad link
project
.
repo
=
'weblate://foo'
project
.
push
=
''
self
.
assertRaisesMessage
(
ValidationError
,
'Invalid link to Weblate project, '
'use weblate://project/subproject.'
,
project
.
full_clean
)
# Bad link
project
.
repo
=
'weblate://foo/bar'
project
.
push
=
''
self
.
assertRaisesMessage
(
ValidationError
,
'Invalid link to Weblate project, '
'use weblate://project/subproject.'
,
project
.
full_clean
)
# Translation validation
translation
=
project
.
translation_set
.
get
(
language_code
=
'cs'
)
translation
.
full_clean
()
...
...
trans/validators.py
View file @
3077a105
...
...
@@ -85,8 +85,13 @@ def validate_repo(val):
repo
=
SubProject
.
objects
.
get_linked
(
val
)
if
repo
is
not
None
and
repo
.
is_repo_link
():
raise
ValidationError
(
_
(
'Can not link to linked repository!'
))
except
SubProject
.
DoesNotExist
:
raise
ValidationError
(
_
(
'Invalid link to repository!'
))
except
(
SubProject
.
DoesNotExist
,
ValueError
):
raise
ValidationError
(
_
(
'Invalid link to Weblate project, '
'use weblate://project/subproject.'
)
)
def
validate_autoaccept
(
val
):
...
...
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