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
cc398620
Commit
cc398620
authored
Mar 12, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor out store merging from upload handling
parent
e5daaf90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
trans/models.py
trans/models.py
+9
-5
No files found.
trans/models.py
View file @
cc398620
...
...
@@ -391,10 +391,7 @@ class Translation(models.Model):
result
.
append
((
'suggestions'
,
_
(
'Strings with suggestions (%d)'
)
%
suggestions
))
return
result
def
merge_upload
(
self
,
request
,
fileobj
,
overwrite
,
mergefuzzy
=
False
):
# Needed to behave like something what translate toolkit expects
fileobj
.
mode
=
"r"
store2
=
factory
.
getobject
(
fileobj
)
def
merge_store
(
self
,
author
,
store2
,
overwrite
,
mergefuzzy
=
False
):
store1
=
self
.
get_store
()
store1
.
require_index
()
...
...
@@ -416,11 +413,18 @@ class Translation(models.Model):
continue
unit1
.
merge
(
unit2
,
overwrite
=
overwrite
)
store1
.
save
()
author
=
self
.
get_author_name
(
request
)
ret
=
self
.
git_commit
(
author
)
self
.
check_sync
()
return
ret
def
merge_upload
(
self
,
request
,
fileobj
,
overwrite
,
mergefuzzy
=
False
):
# Needed to behave like something what translate toolkit expects
fileobj
.
mode
=
"r"
store2
=
factory
.
getobject
(
fileobj
)
author
=
self
.
get_author_name
(
request
)
return
self
.
merge_store
(
author
,
store2
,
overwrite
,
mergefuzzy
)
class
Unit
(
models
.
Model
):
translation
=
models
.
ForeignKey
(
Translation
)
checksum
=
models
.
CharField
(
max_length
=
40
,
default
=
''
,
blank
=
True
,
db_index
=
True
)
...
...
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