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
ef1da0a5
Commit
ef1da0a5
authored
Jan 21, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decouple locking from request
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
f0c783ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+2
-2
weblate/trans/models/unit.py
weblate/trans/models/unit.py
+3
-3
No files found.
weblate/trans/models/translation.py
View file @
ef1da0a5
...
...
@@ -343,7 +343,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
self
.
save
()
def
update_lock
(
self
,
request
):
def
update_lock
(
self
,
user
):
'''
Updates lock timestamp.
'''
...
...
@@ -354,7 +354,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
# Auto lock if we should
if
appsettings
.
AUTO_LOCK
:
self
.
create_lock
(
request
.
user
)
self
.
create_lock
(
user
)
return
def
_reverse_url_name
(
self
):
...
...
weblate/trans/models/unit.py
View file @
ef1da0a5
...
...
@@ -549,13 +549,13 @@ class Unit(models.Model, LoggerMixin):
Optional user parameters defines authorship of a change.
"""
# Update lock timestamp
self
.
translation
.
update_lock
(
request
)
# For case when authorship specified, use user from request
if
user
is
None
:
user
=
request
.
user
# Update lock timestamp
self
.
translation
.
update_lock
(
user
)
# Store to backend
try
:
(
saved
,
pounit
)
=
self
.
translation
.
update_unit
(
self
,
request
,
user
)
...
...
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