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
57d57fd2
Commit
57d57fd2
authored
Feb 15, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document notification hook code (issue #208)
parent
31d919f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
weblate/trans/api.py
weblate/trans/api.py
+7
-0
No files found.
weblate/trans/api.py
View file @
57d57fd2
...
...
@@ -75,10 +75,15 @@ def git_service_hook(request, service):
Currently used for bitbucket_hook and github_hook, but should be usable for
hook from other Git services (Google Code, custom coded sites, etc.) too.
'''
# Check for enabled hooks
if
not
appsettings
.
ENABLE_HOOKS
:
return
HttpResponseNotAllowed
([])
# We support only post methods
if
request
.
method
!=
'POST'
:
return
HttpResponseNotAllowed
([
'POST'
])
# Check if we got payload
try
:
data
=
json
.
loads
(
request
.
POST
[
'payload'
])
except
(
ValueError
,
KeyError
):
...
...
@@ -107,6 +112,8 @@ def git_service_hook(request, service):
'received %s notification on repository %s, branch %s'
,
service_long_name
,
repo
,
branch
)
# Trigger updates
for
obj
in
SubProject
.
objects
.
filter
(
repo
=
repo
,
branch
=
branch
):
logger
.
info
(
'%s notification will update %s'
,
obj
)
if
appsettings
.
BACKGROUND_HOOKS
:
...
...
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