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
73f3bcf3
Commit
73f3bcf3
authored
Apr 20, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates from hooks are run in background.
parent
150e3494
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
docs/changes.rst
docs/changes.rst
+1
-0
weblate/trans/api.py
weblate/trans/api.py
+12
-8
No files found.
docs/changes.rst
View file @
73f3bcf3
...
...
@@ -8,6 +8,7 @@ Relased on ? 2012.
* Improved validation while adding/saving subproject.
* Experimental support for Android resource files (needs patched ttkit).
* Updates from hooks are run in background.
weblate 0.9
-----------
...
...
weblate/trans/api.py
View file @
73f3bcf3
...
...
@@ -8,6 +8,7 @@ from weblate.trans.models import Project, SubProject
import
json
import
logging
import
threading
logger
=
logging
.
getLogger
(
'weblate'
)
...
...
@@ -19,8 +20,9 @@ def update_subproject(request, project, subproject):
if
not
settings
.
ENABLE_HOOKS
:
return
HttpResponseNotAllowed
([])
obj
=
get_object_or_404
(
SubProject
,
slug
=
subproject
,
project__slug
=
project
)
obj
.
do_update
()
return
HttpResponse
(
'updated'
)
t
=
threading
.
Thread
(
target
=
obj
.
do_update
)
t
.
start
()
return
HttpResponse
(
'update triggered'
)
@
csrf_exempt
def
update_project
(
request
,
project
):
...
...
@@ -30,8 +32,9 @@ def update_project(request, project):
if
not
settings
.
ENABLE_HOOKS
:
return
HttpResponseNotAllowed
([])
obj
=
get_object_or_404
(
Project
,
slug
=
project
)
obj
.
do_update
()
return
HttpResponse
(
'updated'
)
t
=
threading
.
Thread
(
target
=
obj
.
do_update
)
t
.
start
()
return
HttpResponse
(
'update triggered'
)
@
csrf_exempt
...
...
@@ -53,11 +56,12 @@ def github_hook(request):
)
branch
=
data
[
'ref'
].
split
(
'/'
)[
-
1
]
logger
.
info
(
'received GitHub notification on repository %s, branch %s'
,
repo
,
branch
)
for
s
in
SubProject
.
objects
.
filter
(
repo
=
repo
,
branch
=
branch
):
logger
.
info
(
'GitHub notification will update %s'
,
s
)
s
.
do_update
()
for
obj
in
SubProject
.
objects
.
filter
(
repo
=
repo
,
branch
=
branch
):
logger
.
info
(
'GitHub notification will update %s'
,
obj
)
t
=
threading
.
Thread
(
target
=
obj
.
do_update
)
t
.
start
()
return
HttpResponse
(
'updated'
)
return
HttpResponse
(
'update
triggere
d'
)
def
dt_handler
(
obj
):
if
hasattr
(
obj
,
'isoformat'
):
...
...
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