# 86 Proper log detail

* adds support for payment adding/deleting to intervention log
* adds support for deduction adding/deleting to intervention/ecoaccount log
* improves code snippets
* drops add_deduction() methods for ecoaccount and intervention in favor of simpler creation in NewDeductionModalForm
* adds messages
* adds/updates translations
This commit is contained in:
2022-02-02 15:16:25 +01:00
parent 4563c222e9
commit b17b0b5144
17 changed files with 289 additions and 266 deletions

View File

@@ -10,6 +10,8 @@ from django.db import models
from intervention.models import Intervention
from konova.models import BaseResource
from konova.utils.message_templates import PAYMENT_REMOVED
from user.models import UserActionLogEntry
class Payment(BaseResource):
@@ -35,3 +37,8 @@ class Payment(BaseResource):
ordering = [
"-amount",
]
def delete(self, user=None, *args, **kwargs):
if user is not None:
self.intervention.mark_as_edited(user, edit_comment=PAYMENT_REMOVED)
super().delete(*args, **kwargs)