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
ed9a2c49
Commit
ed9a2c49
authored
Nov 19, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify changes lookup for translation
parent
5e836d32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
weblate/trans/managers.py
weblate/trans/managers.py
+1
-1
weblate/trans/models.py
weblate/trans/models.py
+3
-3
No files found.
weblate/trans/managers.py
View file @
ed9a2c49
...
...
@@ -263,7 +263,7 @@ class UnitManager(models.Manager):
return
self
.
none
()
from
weblate.trans.models
import
Change
sample
=
self
.
all
()[
0
]
changes
=
Change
.
objects
.
filter
(
unit__
translation
=
sample
.
translation
,
timestamp__gte
=
date
).
exclude
(
user
=
user
)
changes
=
Change
.
objects
.
filter
(
translation
=
sample
.
translation
,
timestamp__gte
=
date
).
exclude
(
user
=
user
)
return
self
.
filter
(
id__in
=
changes
.
values_list
(
'unit__id'
,
flat
=
True
))
def
add_to_source_index
(
self
,
checksum
,
source
,
context
,
writer
):
...
...
weblate/trans/models.py
View file @
ed9a2c49
...
...
@@ -1565,7 +1565,7 @@ class Translation(models.Model):
Returns last autor of change done in Weblate.
'''
try
:
change
=
Change
.
objects
.
filter
(
unit__
translation
=
self
).
order_by
(
'-timestamp'
)[
0
]
change
=
Change
.
objects
.
filter
(
translation
=
self
).
order_by
(
'-timestamp'
)[
0
]
return
self
.
get_author_name
(
change
.
user
,
email
)
except
IndexError
:
return
None
...
...
@@ -1575,7 +1575,7 @@ class Translation(models.Model):
Returns date of last change done in Weblate.
'''
try
:
change
=
Change
.
objects
.
filter
(
unit__
translation
=
self
).
order_by
(
'-timestamp'
)[
0
]
change
=
Change
.
objects
.
filter
(
translation
=
self
).
order_by
(
'-timestamp'
)[
0
]
return
change
.
timestamp
except
IndexError
:
return
None
...
...
@@ -2210,7 +2210,7 @@ class Unit(models.Model):
subscription
.
notify_any_translation
(
self
,
oldunit
)
# Notify about new contributor
if
not
Change
.
objects
.
filter
(
unit__
translation
=
self
.
translation
,
user
=
request
.
user
).
exists
():
if
not
Change
.
objects
.
filter
(
translation
=
self
.
translation
,
user
=
request
.
user
).
exists
():
# Get list of subscribers for new contributor
subscriptions
=
Profile
.
objects
.
subscribed_new_contributor
(
self
.
translation
.
subproject
.
project
,
...
...
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