* adds support for GET /check on intervention to run checks automatically via API
This commit is contained in:
2022-01-25 09:29:14 +01:00
parent 096688fad5
commit 0b723b1529
8 changed files with 132 additions and 35 deletions

View File

@@ -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:

View File

@@ -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,