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
db1f0a4d
Commit
db1f0a4d
authored
Oct 30, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filtering for all source checks
parent
68e988b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
weblate/trans/managers.py
weblate/trans/managers.py
+4
-2
weblate/trans/models.py
weblate/trans/models.py
+3
-0
No files found.
weblate/trans/managers.py
View file @
db1f0a4d
...
...
@@ -172,7 +172,7 @@ class UnitManager(models.Manager):
project
=
translation
.
subproject
.
project
)
sugs
=
sugs
.
values_list
(
'checksum'
,
flat
=
True
)
return
self
.
filter
(
checksum__in
=
sugs
)
elif
rqtype
in
CHECKS
or
rqtype
==
'allchecks'
:
elif
rqtype
in
CHECKS
or
rqtype
in
[
'allchecks'
,
'sourcechecks'
]
:
# Filter checks for current project
checks
=
Check
.
objects
.
filter
(
...
...
@@ -183,6 +183,8 @@ class UnitManager(models.Manager):
# Filter by language
if
rqtype
==
'allchecks'
:
checks
=
checks
.
filter
(
language
=
translation
.
language
)
elif
rqtype
==
'sourcechecks'
:
checks
=
checks
.
filter
(
language
=
None
)
elif
CHECKS
[
rqtype
].
source
and
check_obj
.
target
:
checks
=
checks
.
filter
(
Q
(
language
=
translation
.
language
)
|
Q
(
language
=
None
)
...
...
@@ -193,7 +195,7 @@ class UnitManager(models.Manager):
checks
=
checks
.
filter
(
language
=
translation
.
language
)
# Filter by check type
if
rqtype
!=
'allchecks'
:
if
not
rqtype
in
[
'allchecks'
,
'sourcechecks'
]
:
checks
=
checks
.
filter
(
check
=
rqtype
)
checks
=
checks
.
values_list
(
'checksum'
,
flat
=
True
)
...
...
weblate/trans/models.py
View file @
db1f0a4d
...
...
@@ -1790,6 +1790,9 @@ class Translation(models.Model):
Returns list of failing source checks on current subproject.
'''
result
=
[(
'all'
,
_
(
'All strings'
))]
sourcechecks
=
self
.
unit_set
.
count_type
(
'sourcechecks'
,
self
)
if
sourcechecks
>
0
:
result
.
append
((
'sourcechecks'
,
_
(
'Strings with any failing checks (%d)'
)
%
sourcechecks
))
return
result
def
get_translation_checks
(
self
):
...
...
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