# 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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user