#31 API WIP
* adds support for GET /check on intervention to run checks automatically via API
This commit is contained in:
@@ -75,9 +75,7 @@ def default_group_required(function):
|
||||
@wraps(function)
|
||||
def wrap(request, *args, **kwargs):
|
||||
user = request.user
|
||||
has_group = user.groups.filter(
|
||||
name=DEFAULT_GROUP
|
||||
).exists()
|
||||
has_group = user.is_default_user()
|
||||
if has_group:
|
||||
return function(request, *args, **kwargs)
|
||||
else:
|
||||
@@ -95,9 +93,7 @@ def registration_office_group_required(function):
|
||||
@wraps(function)
|
||||
def wrap(request, *args, **kwargs):
|
||||
user = request.user
|
||||
has_group = user.groups.filter(
|
||||
name=ZB_GROUP
|
||||
).exists()
|
||||
has_group = user.is_zb_user()
|
||||
if has_group:
|
||||
return function(request, *args, **kwargs)
|
||||
else:
|
||||
@@ -115,9 +111,7 @@ def conservation_office_group_required(function):
|
||||
@wraps(function)
|
||||
def wrap(request, *args, **kwargs):
|
||||
user = request.user
|
||||
has_group = user.groups.filter(
|
||||
name=ETS_GROUP
|
||||
).exists()
|
||||
has_group = user.is_ets_user()
|
||||
if has_group:
|
||||
return function(request, *args, **kwargs)
|
||||
else:
|
||||
|
||||
@@ -277,7 +277,8 @@ class RecordableObjectMixin(models.Model):
|
||||
self.save()
|
||||
|
||||
if self.recorded:
|
||||
self.set_unrecorded(performing_user)
|
||||
action = self.set_unrecorded(performing_user)
|
||||
self.log.add(action)
|
||||
if request:
|
||||
messages.info(
|
||||
request,
|
||||
|
||||
Reference in New Issue
Block a user