reviewboard.notifications.managers¶
-
class
WebHookTargetManager
[source]¶ Bases:
django.db.models.manager.Manager
Manages WebHookTarget models.
This provides a utility function for querying WebHookTargets for a given event.
-
for_event
(event, local_site_id=None, repository_id=None)[source]¶ Returns a list of matching webhook targets for the given event.
-
for_local_site
(local_site=None)[source]¶ Return a list of webhooks on the local site.
Parameters: local_site (reviewboard.site.models.LocalSite) – An optional local site. Returns: A queryset matching all accessible webhooks. Return type: django.db.models.query.QuerySet
-
can_create
(user, local_site=None)[source]¶ Return whether the user can create webhooks on the local site.
Parameters: - user (django.contrib.auth.models.User) – The user to check for permissions.
- local_site (reviewboard.site.models.LocalSite) – The current local site, if it exists.
Returns: Whether or not the use can create a webhook on the local site.
Return type:
-