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
2f13265e
Commit
2f13265e
authored
Jul 26, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use standard way of counting checks
parent
00b0a210
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
weblate/trans/models.py
weblate/trans/models.py
+2
-14
No files found.
weblate/trans/models.py
View file @
2f13265e
...
...
@@ -1493,25 +1493,13 @@ class Translation(models.Model):
return
ret
def
get_failing_checks
(
self
,
check
=
None
):
def
get_failing_checks
(
self
,
check
=
'allchecks'
):
'''
Returns number of units with failing checks.
By default for all checks or check type can be specified.
'''
cache_key
=
'checks-%s-%s'
%
(
self
.
subproject
.
get_full_slug
(),
self
.
language
.
code
)
if
check
is
None
:
checks
=
Check
.
objects
.
all
()
else
:
cache_key
+=
'-%s'
%
check
checks
=
Check
.
objects
.
filter
(
check
=
check
)
ret
=
cache
.
get
(
cache_key
)
if
ret
is
not
None
:
return
ret
checks
=
checks
.
filter
(
project
=
self
.
subproject
.
project
,
language
=
self
.
language
,
ignore
=
False
).
values_list
(
'checksum'
,
flat
=
True
)
ret
=
self
.
unit_set
.
filter
(
checksum__in
=
checks
,
translated
=
True
).
count
()
cache
.
set
(
cache_key
,
ret
)
return
ret
return
self
.
unit_set
.
count_type
(
check
,
self
)
class
Unit
(
models
.
Model
):
translation
=
models
.
ForeignKey
(
Translation
)
...
...
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