Intervention check
* adds functionality for check button * adds highlighting of important data on detail view for intervention * adds deleting logic to BaseObject model and BaseResource model * adds RunCheckForm * adds check_validity() method to Intervention class * fixes wrong success msg for adding documents * adds/updates translations
This commit is contained in:
@@ -17,7 +17,6 @@ from compensation.settings import COMPENSATION_IDENTIFIER_LENGTH, COMPENSATION_I
|
||||
from intervention.models import Intervention, ResponsibilityData
|
||||
from konova.models import BaseObject, BaseResource, Geometry, UuidModel
|
||||
from konova.utils.generators import generate_random_string
|
||||
from organisation.models import Organisation
|
||||
from user.models import UserActionLogEntry, UserAction
|
||||
|
||||
|
||||
@@ -154,29 +153,6 @@ class Compensation(AbstractCompensation):
|
||||
_str = "{}{}{}".format(curr_month, curr_year, rand_str)
|
||||
return COMPENSATION_IDENTIFIER_TEMPLATE.format(_str)
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
""" Custom delete functionality
|
||||
|
||||
Does not delete from database but sets a timestamp for being deleted on and which user deleted the object
|
||||
|
||||
Args:
|
||||
*args ():
|
||||
**kwargs ():
|
||||
|
||||
Returns:
|
||||
|
||||
"""
|
||||
_now = timezone.now()
|
||||
_user = kwargs.get("user", None)
|
||||
with transaction.atomic():
|
||||
action = UserActionLogEntry.objects.create(
|
||||
user=_user,
|
||||
timestamp=_now,
|
||||
action=UserAction.DELETED
|
||||
)
|
||||
self.deleted = action
|
||||
self.save()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.identifier is None or len(self.identifier) == 0:
|
||||
# Create new identifier
|
||||
|
||||
Reference in New Issue
Block a user