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
e71ec920
Commit
e71ec920
authored
Apr 12, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method for last change date
parent
d05c6dc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
trans/models.py
trans/models.py
+13
-0
No files found.
trans/models.py
View file @
e71ec920
...
...
@@ -612,12 +612,25 @@ class Translation(models.Model):
self
.
save
()
def
get_last_author
(
self
):
'''
Returns last autor of change done in Weblate.
'''
try
:
change
=
Change
.
objects
.
filter
(
unit__translation
=
self
).
order_by
(
'-timestamp'
)[
0
]
return
self
.
get_author_name
(
change
.
user
)
except
IndexError
:
return
None
def
get_last_change
(
self
):
'''
Returns date of last change done in Weblate.
'''
try
:
change
=
Change
.
objects
.
filter
(
unit__translation
=
self
).
order_by
(
'-timestamp'
)[
0
]
return
change
.
timestamp
except
IndexError
:
return
None
def
commit_pending
(
self
,
author
=
None
):
last
=
self
.
get_last_author
()
if
author
==
last
or
last
is
None
:
...
...
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