Withdraw to deduct
* refactors all files and variable names * WIP: Models and attributes
This commit is contained in:
@@ -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")
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user