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
fd988745
Commit
fd988745
authored
Oct 30, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use timezone aware timestamps for locking
Issue #892 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
e1cbf407
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+4
-5
No files found.
weblate/trans/models/translation.py
View file @
fd988745
...
...
@@ -135,7 +135,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
language_code
=
models
.
CharField
(
max_length
=
20
,
default
=
''
)
lock_user
=
models
.
ForeignKey
(
User
,
null
=
True
,
blank
=
True
,
default
=
None
)
lock_time
=
models
.
DateTimeField
(
default
=
datetim
e
.
now
)
lock_time
=
models
.
DateTimeField
(
default
=
timezon
e
.
now
)
commit_message
=
models
.
TextField
(
default
=
''
,
blank
=
True
)
...
...
@@ -292,9 +292,8 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
# Any user?
if
self
.
lock_user
is
None
:
return
False
# Is lock still valid?
elif
self
.
lock_time
<
datetim
e
.
now
():
elif
self
.
lock_time
<
timezon
e
.
now
():
# Clear the lock
self
.
create_lock
(
None
)
...
...
@@ -316,7 +315,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
# Clean timestamp on unlock
if
user
is
None
:
self
.
lock_time
=
datetim
e
.
now
()
self
.
lock_time
=
timezon
e
.
now
()
self
.
save
()
return
...
...
@@ -331,7 +330,7 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
else
:
seconds
=
appsettings
.
AUTO_LOCK_TIME
new_lock_time
=
datetim
e
.
now
()
+
timedelta
(
seconds
=
seconds
)
new_lock_time
=
timezon
e
.
now
()
+
timedelta
(
seconds
=
seconds
)
if
is_new
or
new_lock_time
>
self
.
lock_time
:
self
.
lock_time
=
new_lock_time
...
...
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