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
a1e4cd81
Commit
a1e4cd81
authored
Apr 08, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make API request report it's state rather than repo status
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
8a7132fd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
docs/api.rst
docs/api.rst
+1
-2
weblate/api/views.py
weblate/api/views.py
+7
-2
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 @
a1e4cd81
...
...
@@ -210,12 +210,11 @@ Projects
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``
:param project: Project URL slug
:type project: string
:>json boolean result: result of the operation
.. seealso::
...
...
weblate/api/views.py
View file @
a1e4cd81
...
...
@@ -93,7 +93,7 @@ class WeblateViewSet(viewsets.ReadOnlyModelViewSet):
if
not
permission_check
(
request
.
user
,
project
):
raise
PermissionDenied
()
getattr
(
obj
,
method
)(
request
)
return
getattr
(
obj
,
method
)(
request
)
@
detail_route
(
methods
=
[
'get'
,
'post'
],
...
...
@@ -113,9 +113,14 @@ class WeblateViewSet(viewsets.ReadOnlyModelViewSet):
serializer
=
RepoRequestSerializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
self
.
repository_operation
(
result
=
self
.
repository_operation
(
request
,
obj
,
project
,
serializer
.
validated_data
[
'operation'
]
)
return
Response
(
data
=
{
'result'
:
result
}
)
if
not
can_see_repository_status
(
request
.
user
,
project
):
raise
PermissionDenied
()
...
...
weblate/trans/models/subproject.py
View file @
a1e4cd81
...
...
@@ -852,6 +852,8 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
if
not
from_link
and
not
skip_push
:
self
.
push_if_needed
(
request
)
return
True
def
handle_parse_error
(
self
,
error
,
translation
=
None
):
"""Handler for parse error."""
report_error
(
error
,
sys
.
exc_info
())
...
...
weblate/trans/models/translation.py
View file @
a1e4cd81
...
...
@@ -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
author
==
last
or
last
is
None
:
return
return
False
# Commit changes
self
.
git_commit
(
request
,
last
,
self
.
last_change
,
True
,
True
,
skip_push
)
return
True
def
get_commit_message
(
self
):
"""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