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
2bdb46b9
Commit
2bdb46b9
authored
Apr 08, 2016
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c7a5af92
a1e4cd81
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
7 deletions
+20
-7
docs/api.rst
docs/api.rst
+1
-2
weblate/api/views.py
weblate/api/views.py
+15
-4
weblate/trans/models/subproject.py
weblate/trans/models/subproject.py
+2
-0
weblate/trans/models/translation.py
weblate/trans/models/translation.py
+2
-1
No files found.
docs/api.rst
View file @
2bdb46b9
...
@@ -210,12 +210,11 @@ Projects
...
@@ -210,12 +210,11 @@ Projects
Performs given operation on the VCS repository.
Performs given operation on the VCS repository.
The response is same as for :http:get:`/api/projects/(string:project)/repository/`.
:query operation: Operation to perform, one of ``push``, ``pull``, ``commit``, ``reset``
:query operation: Operation to perform, one of ``push``, ``pull``, ``commit``, ``reset``
:param project: Project URL slug
:param project: Project URL slug
:type project: string
:type project: string
:>json boolean result: result of the operation
.. seealso::
.. seealso::
...
...
weblate/api/views.py
View file @
2bdb46b9
...
@@ -93,9 +93,12 @@ class WeblateViewSet(viewsets.ReadOnlyModelViewSet):
...
@@ -93,9 +93,12 @@ class WeblateViewSet(viewsets.ReadOnlyModelViewSet):
if
not
permission_check
(
request
.
user
,
project
):
if
not
permission_check
(
request
.
user
,
project
):
raise
PermissionDenied
()
raise
PermissionDenied
()
getattr
(
obj
,
method
)(
request
)
return
getattr
(
obj
,
method
)(
request
)
@
detail_route
(
methods
=
[
'get'
,
'post'
])
@
detail_route
(
methods
=
[
'get'
,
'post'
],
serializer_class
=
RepoRequestSerializer
)
def
repository
(
self
,
request
,
**
kwargs
):
def
repository
(
self
,
request
,
**
kwargs
):
obj
=
self
.
get_object
()
obj
=
self
.
get_object
()
...
@@ -110,9 +113,14 @@ class WeblateViewSet(viewsets.ReadOnlyModelViewSet):
...
@@ -110,9 +113,14 @@ class WeblateViewSet(viewsets.ReadOnlyModelViewSet):
serializer
=
RepoRequestSerializer
(
data
=
request
.
data
)
serializer
=
RepoRequestSerializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
serializer
.
is_valid
(
raise_exception
=
True
)
self
.
repository_operation
(
result
=
self
.
repository_operation
(
request
,
obj
,
project
,
serializer
.
validated_data
[
'operation'
]
request
,
obj
,
project
,
serializer
.
validated_data
[
'operation'
]
)
)
return
Response
(
data
=
{
'result'
:
result
}
)
if
not
can_see_repository_status
(
request
.
user
,
project
):
if
not
can_see_repository_status
(
request
.
user
,
project
):
raise
PermissionDenied
()
raise
PermissionDenied
()
...
@@ -175,7 +183,10 @@ class ComponentViewSet(MultipleFieldMixin, WeblateViewSet):
...
@@ -175,7 +183,10 @@ class ComponentViewSet(MultipleFieldMixin, WeblateViewSet):
'project__source_language'
'project__source_language'
)
)
@
detail_route
(
methods
=
[
'get'
,
'post'
])
@
detail_route
(
methods
=
[
'get'
,
'post'
],
serializer_class
=
LockRequestSerializer
)
def
lock
(
self
,
request
,
**
kwargs
):
def
lock
(
self
,
request
,
**
kwargs
):
obj
=
self
.
get_object
()
obj
=
self
.
get_object
()
...
...
weblate/trans/models/subproject.py
View file @
2bdb46b9
...
@@ -852,6 +852,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
...
@@ -852,6 +852,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
if
not
from_link
and
not
skip_push
:
if
not
from_link
and
not
skip_push
:
self
.
push_if_needed
(
request
)
self
.
push_if_needed
(
request
)
return
True
def
handle_parse_error
(
self
,
error
,
translation
=
None
):
def
handle_parse_error
(
self
,
error
,
translation
=
None
):
"""Handler for parse error."""
"""Handler for parse error."""
report_error
(
error
,
sys
.
exc_info
())
report_error
(
error
,
sys
.
exc_info
())
...
...
weblate/trans/models/translation.py
View file @
2bdb46b9
...
@@ -665,12 +665,13 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
...
@@ -665,12 +665,13 @@ class Translation(models.Model, URLMixin, PercentMixin, LoggerMixin):
# If it is same as current one, we don't have to commit
# If it is same as current one, we don't have to commit
if
author
==
last
or
last
is
None
:
if
author
==
last
or
last
is
None
:
return
return
False
# Commit changes
# Commit changes
self
.
git_commit
(
self
.
git_commit
(
request
,
last
,
self
.
last_change
,
True
,
True
,
skip_push
request
,
last
,
self
.
last_change
,
True
,
True
,
skip_push
)
)
return
True
def
get_commit_message
(
self
):
def
get_commit_message
(
self
):
"""Formats commit message based on project configuration."""
"""Formats commit message based on project configuration."""
...
...
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