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
ace1d24f
Commit
ace1d24f
authored
Mar 26, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup Unit.save
parent
5b805139
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
trans/models.py
trans/models.py
+12
-5
No files found.
trans/models.py
View file @
ace1d24f
...
...
@@ -582,16 +582,23 @@ class Unit(models.Model):
unit
.
save_backend
(
request
,
False
)
def
save
(
self
,
*
args
,
**
kwargs
):
'''
Wrapper around save to warn when save did not come from
git backend (eg. commit or by parsing file).
'''
# Warn if request is not coming from backend
if
not
'backend'
in
kwargs
:
logger
.
error
(
'Unit.save called without backend sync: %s'
,
''
.
join
(
traceback
.
format_stack
()))
else
:
del
kwargs
[
'backend'
]
if
'same_content'
in
kwargs
:
same_content
=
kwargs
[
'same_content'
]
del
kwargs
[
'same_content'
]
else
:
same_content
=
False
# Pop parameter indicating that we don't have to process content
same_content
=
kwargs
.
pop
(
'same_content'
,
False
)
# Actually save the unit
super
(
Unit
,
self
).
save
(
*
args
,
**
kwargs
)
# Update checks and fulltext index if content has changed
if
not
same_content
:
self
.
check
()
Unit
.
objects
.
add_to_index
(
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