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
d7938970
Commit
d7938970
authored
Jul 19, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better check for existence
parent
a0d156b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
weblate/lang/models.py
weblate/lang/models.py
+1
-1
weblate/trans/management/commands/cleanuptrans.py
weblate/trans/management/commands/cleanuptrans.py
+2
-2
weblate/trans/views.py
weblate/trans/views.py
+1
-1
No files found.
weblate/lang/models.py
View file @
d7938970
...
@@ -173,7 +173,7 @@ class Language(models.Model):
...
@@ -173,7 +173,7 @@ class Language(models.Model):
Checks whether there is a translation existing for this language.
Checks whether there is a translation existing for this language.
'''
'''
from
weblate.trans.models
import
Translation
from
weblate.trans.models
import
Translation
return
Translation
.
objects
.
filter
(
language
=
self
).
count
()
>
0
return
Translation
.
objects
.
filter
(
language
=
self
).
exists
()
def
get_translated_percent
(
self
):
def
get_translated_percent
(
self
):
'''
'''
...
...
weblate/trans/management/commands/cleanuptrans.py
View file @
d7938970
...
@@ -23,9 +23,9 @@ class Command(BaseCommand):
...
@@ -23,9 +23,9 @@ class Command(BaseCommand):
for
sug
in
Suggestion
.
objects
.
filter
(
language
=
lang
,
project
=
prj
).
iterator
():
for
sug
in
Suggestion
.
objects
.
filter
(
language
=
lang
,
project
=
prj
).
iterator
():
# Remove suggestions with same text as real translation
# Remove suggestions with same text as real translation
units
=
Unit
.
objects
.
filter
(
checksum
=
sug
.
checksum
,
translation__language
=
lang
,
translation__subproject__project
=
prj
,
target
=
sug
.
target
)
units
=
Unit
.
objects
.
filter
(
checksum
=
sug
.
checksum
,
translation__language
=
lang
,
translation__subproject__project
=
prj
,
target
=
sug
.
target
)
if
units
.
count
()
>
0
:
if
units
.
exists
()
:
sug
.
delete
()
sug
.
delete
()
# Remove duplicate suggestions
# Remove duplicate suggestions
sugs
=
Suggestion
.
objects
.
filter
(
checksum
=
sug
.
checksum
,
language
=
lang
,
project
=
prj
,
target
=
sug
.
target
).
exclude
(
id
=
sug
.
id
)
sugs
=
Suggestion
.
objects
.
filter
(
checksum
=
sug
.
checksum
,
language
=
lang
,
project
=
prj
,
target
=
sug
.
target
).
exclude
(
id
=
sug
.
id
)
if
sugs
.
count
()
>
0
:
if
sugs
.
exists
()
:
sugs
.
delete
()
sugs
.
delete
()
weblate/trans/views.py
View file @
d7938970
...
@@ -318,7 +318,7 @@ def auto_translation(request, project, subproject, lang):
...
@@ -318,7 +318,7 @@ def auto_translation(request, project, subproject, lang):
for
unit
in
units
.
iterator
():
for
unit
in
units
.
iterator
():
update
=
sources
.
filter
(
checksum
=
unit
.
checksum
)
update
=
sources
.
filter
(
checksum
=
unit
.
checksum
)
if
update
.
count
()
>
0
:
if
update
.
exists
()
:
# Get first entry
# Get first entry
update
=
update
[
0
]
update
=
update
[
0
]
# No save if translation is same
# No save if translation is same
...
...
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