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
98cbd2bd
Commit
98cbd2bd
authored
Apr 23, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move adding fake attribute to ttkit wrapper
parent
800aba7d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
weblate/trans/models.py
weblate/trans/models.py
+6
-4
No files found.
weblate/trans/models.py
View file @
98cbd2bd
...
...
@@ -29,7 +29,7 @@ from util import is_plural, split_plural, join_plural
logger
=
logging
.
getLogger
(
'weblate'
)
def
ttkit
(
path
):
def
ttkit
(
storefile
):
'''
Returns translate-toolkit storage for a path.
'''
...
...
@@ -39,7 +39,11 @@ def ttkit(path):
if
not
callable
(
__builtin__
.
__dict__
[
'_'
]):
del
__builtin__
.
__dict__
[
'_'
]
return
factory
.
getobject
(
path
)
# Add missing mode attribute to Django file wrapper
if
not
isinstance
(
storefile
,
basestring
):
storefile
.
mode
=
'r'
return
factory
.
getobject
(
storefile
)
def
validate_repoweb
(
val
):
...
...
@@ -911,8 +915,6 @@ class Translation(models.Model):
'''
Top level handler for file uploads.
'''
# Needed to behave like something what translate toolkit expects
fileobj
.
mode
=
"r"
store2
=
ttkit
(
fileobj
)
if
author
is
None
:
author
=
self
.
get_author_name
(
request
.
user
)
...
...
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