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
eb88a059
Commit
eb88a059
authored
Mar 24, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various code fixes
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
a0ba4cdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
weblate/api/views.py
weblate/api/views.py
+4
-2
No files found.
weblate/api/views.py
View file @
eb88a059
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
from
django.core.exceptions
import
PermissionDenied
from
django.shortcuts
import
get_object_or_404
from
django.shortcuts
import
get_object_or_404
from
django.http
import
Http404
from
django.http
import
Http404
...
@@ -149,8 +150,8 @@ class TranslationViewSet(MultipleFieldMixin, RawFileViewSet):
...
@@ -149,8 +150,8 @@ class TranslationViewSet(MultipleFieldMixin, RawFileViewSet):
fmt
=
self
.
format_kwarg
or
request
.
query_params
.
get
(
'format'
)
fmt
=
self
.
format_kwarg
or
request
.
query_params
.
get
(
'format'
)
return
download_translation_file
(
obj
,
fmt
)
return
download_translation_file
(
obj
,
fmt
)
elif
request
.
method
in
(
'PUT'
,
'POST'
):
elif
request
.
method
in
(
'PUT'
,
'POST'
):
if
(
not
can_upload_translation
(
request
.
user
,
obj
)
if
(
not
can_upload_translation
(
request
.
user
,
obj
)
or
o
r
o
bj
.
is_locked
(
request
.
user
)):
obj
.
is_locked
(
request
.
user
)):
raise
PermissionDenied
()
raise
PermissionDenied
()
ret
,
count
=
obj
.
merge_upload
(
ret
,
count
=
obj
.
merge_upload
(
...
@@ -161,6 +162,7 @@ class TranslationViewSet(MultipleFieldMixin, RawFileViewSet):
...
@@ -161,6 +162,7 @@ class TranslationViewSet(MultipleFieldMixin, RawFileViewSet):
return
Response
(
data
=
{
'result'
:
ret
,
'count'
:
count
})
return
Response
(
data
=
{
'result'
:
ret
,
'count'
:
count
})
class
LanguageViewSet
(
viewsets
.
ReadOnlyModelViewSet
):
class
LanguageViewSet
(
viewsets
.
ReadOnlyModelViewSet
):
"""Languages API.
"""Languages API.
"""
"""
...
...
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