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
82e70dcc
Commit
82e70dcc
authored
Oct 22, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for file lock error when updating repository
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
d9fc28cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
weblate/trans/views/git.py
weblate/trans/views/git.py
+19
-12
No files found.
weblate/trans/views/git.py
View file @
82e70dcc
...
...
@@ -25,6 +25,7 @@ from django.contrib.auth.decorators import login_required, permission_required
from
weblate.trans.views.helper
import
(
get_project
,
get_subproject
,
get_translation
)
from
weblate.trans.filelock
import
FileLockException
@
login_required
...
...
@@ -60,15 +61,27 @@ def commit_translation(request, project, subproject, lang):
return
redirect
(
obj
)
def
perform_update
(
request
,
obj
):
"""
Helper function to do the repository update.
"""
try
:
if
obj
.
do_update
(
request
,
method
=
request
.
GET
.
get
(
'method'
,
None
)):
messages
.
success
(
request
,
_
(
'All repositories were updated.'
))
except
FileLockException
:
messages
.
error
(
request
,
_
(
'Failed to update repository, another update in progress.'
)
)
return
redirect
(
obj
)
@
login_required
@
permission_required
(
'trans.update_translation'
)
def
update_project
(
request
,
project
):
obj
=
get_project
(
request
,
project
)
if
obj
.
do_update
(
request
,
method
=
request
.
GET
.
get
(
'method'
,
None
)):
messages
.
success
(
request
,
_
(
'All repositories were updated.'
))
return
redirect
(
obj
)
return
perform_update
(
request
,
obj
)
@
login_required
...
...
@@ -76,10 +89,7 @@ def update_project(request, project):
def
update_subproject
(
request
,
project
,
subproject
):
obj
=
get_subproject
(
request
,
project
,
subproject
)
if
obj
.
do_update
(
request
,
method
=
request
.
GET
.
get
(
'method'
,
None
)):
messages
.
success
(
request
,
_
(
'All repositories were updated.'
))
return
redirect
(
obj
)
return
perform_update
(
request
,
obj
)
@
login_required
...
...
@@ -87,10 +97,7 @@ def update_subproject(request, project, subproject):
def
update_translation
(
request
,
project
,
subproject
,
lang
):
obj
=
get_translation
(
request
,
project
,
subproject
,
lang
)
if
obj
.
do_update
(
request
,
method
=
request
.
GET
.
get
(
'method'
,
None
)):
messages
.
success
(
request
,
_
(
'All repositories were updated.'
))
return
redirect
(
obj
)
return
perform_update
(
request
,
obj
)
@
login_required
...
...
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