Withdraw to deduct

* refactors all files and variable names
* WIP: Models and attributes
This commit is contained in:
mipel
2021-08-30 11:29:15 +02:00
parent 8a62f6c46b
commit cd5fb9cad6
15 changed files with 117 additions and 117 deletions

View File

@@ -5,7 +5,7 @@ from django.http import HttpRequest
from django.shortcuts import render, get_object_or_404
from intervention.forms import NewInterventionForm, EditInterventionForm, ShareInterventionForm, NewRevocationForm, \
RunCheckForm, NewWithdrawForm
RunCheckForm, NewDeductionForm
from intervention.models import Intervention, Revocation
from intervention.tables import InterventionTable
from konova.contexts import BaseContext
@@ -341,21 +341,21 @@ def log_view(request: HttpRequest, id: str):
@login_required
@default_group_required
def new_withdraw_view(request: HttpRequest, id: str):
""" Renders a modal form view for creating withdraws
def new_deduction_view(request: HttpRequest, id: str):
""" Renders a modal form view for creating deductions
Args:
request (HttpRequest): The incoming request
id (str): The intervention's id which shall get a new withdraw
id (str): The intervention's id which shall benefit from this deduction
Returns:
"""
intervention = get_object_or_404(Intervention, id=id)
form = NewWithdrawForm(request.POST or None, instance=intervention, user=request.user)
form = NewDeductionForm(request.POST or None, instance=intervention, user=request.user)
return form.process_request(
request,
msg_success=_("Withdraw added")
msg_success=_("Deduction added")
)