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
6aede7af
Commit
6aede7af
authored
Mar 05, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Safer author name generating
parent
d9afaea9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
trans/models.py
trans/models.py
+8
-2
No files found.
trans/models.py
View file @
6aede7af
...
...
@@ -296,6 +296,12 @@ class Translation(models.Model):
self
.
revision
=
blob
.
hexsha
self
.
save
()
def
get_author_name
(
self
,
request
):
full_name
=
request
.
user
.
get_full_name
()
if
full_name
==
''
:
full_name
=
request
.
user
.
username
return
'%s <%s>'
%
(
full_name
,
request
.
user
.
email
)
def
git_commit
(
self
,
author
):
'''
Commits translation to git.
...
...
@@ -336,7 +342,7 @@ class Translation(models.Model):
# We should have only one match
break
if
need_save
:
author
=
'%s <%s>'
%
(
request
.
user
.
get_full_name
(),
request
.
user
.
email
)
author
=
self
.
get_author_name
(
request
)
if
hasattr
(
store
,
'updateheader'
):
po_revision_date
=
datetime
.
now
().
strftime
(
'%Y-%m-%d %H:%M'
)
+
poheader
.
tzstring
()
...
...
@@ -394,7 +400,7 @@ class Translation(models.Model):
continue
unit1
.
merge
(
unit2
,
overwrite
=
overwrite
)
store1
.
save
()
author
=
u'%s <%s>'
%
(
request
.
user
.
get_full_name
(),
request
.
user
.
email
)
author
=
self
.
get_author_name
(
request
)
ret
=
self
.
git_commit
(
author
)
self
.
check_sync
()
return
ret
...
...
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