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
943ee999
Commit
943ee999
authored
Apr 09, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce exception nesting
parent
2a377322
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
75 deletions
+78
-75
trans/views/edit.py
trans/views/edit.py
+78
-75
No files found.
trans/views/edit.py
View file @
943ee999
...
...
@@ -161,9 +161,10 @@ def handle_translate(obj, request, user_locked, this_unit_url, next_unit_url):
form
=
TranslationForm
(
request
.
POST
)
if
not
form
.
is_valid
():
return
# Check whether translation is not outdated
obj
.
check_sync
()
try
:
try
:
unit
=
Unit
.
objects
.
get
(
checksum
=
form
.
cleaned_data
[
'checksum'
],
...
...
@@ -176,6 +177,17 @@ def handle_translate(obj, request, user_locked, this_unit_url, next_unit_url):
checksum
=
form
.
cleaned_data
[
'checksum'
],
translation
=
obj
)[
0
]
except
Unit
.
DoesNotExist
:
weblate
.
logger
.
error
(
'message %s disappeared!'
,
form
.
cleaned_data
[
'checksum'
]
)
messages
.
error
(
request
,
_
(
'Message you wanted to translate is no longer available!'
)
)
return
if
'suggest'
in
request
.
POST
:
# Handle suggesion saving
user
=
request
.
user
...
...
@@ -239,15 +251,6 @@ def handle_translate(obj, request, user_locked, this_unit_url, next_unit_url):
# Redirect to next entry
return
HttpResponseRedirect
(
next_unit_url
)
except
Unit
.
DoesNotExist
:
weblate
.
logger
.
error
(
'message %s disappeared!'
,
form
.
cleaned_data
[
'checksum'
]
)
messages
.
error
(
request
,
_
(
'Message you wanted to translate is no longer available!'
)
)
def
handle_merge
(
obj
,
request
,
next_unit_url
):
...
...
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