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
9db24351
Commit
9db24351
authored
Jan 27, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update lock time only for owned locks
Issue #983 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
60f18746
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+7
-3
weblate/trans/views/lock.py
weblate/trans/views/lock.py
+1
-2
No files found.
weblate/trans/models/translation.py
View file @
9db24351
...
...
@@ -343,17 +343,21 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
self
.
save
()
def
update_lock
(
self
,
user
):
def
update_lock
(
self
,
user
,
create
=
True
):
'''
Updates lock timestamp.
'''
# Check if we can lock
if
self
.
is_user_locked
(
user
):
return
# Update timestamp
if
self
.
is_user_locked
()
:
if
self
.
lock_user
==
user
:
self
.
update_lock_time
()
return
# Auto lock if we should
if
appsettings
.
AUTO_LOCK
:
if
appsettings
.
AUTO_LOCK
and
create
:
self
.
create_lock
(
user
)
return
...
...
weblate/trans/views/lock.py
View file @
9db24351
...
...
@@ -37,8 +37,7 @@ from weblate.trans.permissions import (
def
update_lock
(
request
,
project
,
subproject
,
lang
):
obj
=
get_translation
(
request
,
project
,
subproject
,
lang
)
if
not
obj
.
is_user_locked
(
request
.
user
):
obj
.
update_lock_time
()
obj
.
update_lock
(
request
.
user
,
False
)
return
HttpResponse
(
'ok'
)
...
...
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