reviewboard.notifications.models¶
-
class
WebHookTarget
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
A target for a webhook.
A webhook target is a URL which will receive a POST request when the corresponding event occurs.
-
EVENT_CHOICES
= ((u’*’, _(u’All events’)), (u’review_request_closed’, _(u’Review request closed’)), (u’review_request_published’, _(u’Review request published’)), (u’review_request_reopened’, _(u’Review request reopened’)), (u’review_published’, _(u’Review published’)), (u’reply_published’, _(u’Reply published’)))[source]¶
-
ALL_ENCODINGS
= (u’application/json’, u’application/xml’, u’application/x-www-form-urlencoded’)[source]¶
-
ENCODINGS
= ((u’application/json’, _(u’JSON’)), (u’application/xml’, _(u’XML’)), (u’application/x-www-form-urlencoded’, _(u’Form Data’)))[source]¶
-
APPLY_TO_CHOICES
= ((u’A’, _(u’All review requests’)), (u’S’, _(u’Only review requests on selected repositories’)), (u’N’, _(u’Only review requests not associated with a repository (file attachments only)’)))[source]¶
-
events
¶ A placeholder class that provides a way to set the attribute on the model.
-
is_accessible_by
(user, local_site=None)[source]¶ Return if the webhook can be accessed or modified by the user.
All superusers and admins of the webhook’s local site can access and modify the webhook.
Parameters: - user (django.contrib.auth.models.User) – The user who is trying to access the webhook.
- local_site (reviewboard.site.models.LocalSite) – The current local site, if it exists.
Returns: Whether or not the given user can access or modify the webhook through the given local site.
Return type:
-