You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
875 B
Python
35 lines
875 B
Python
from django.shortcuts import render, get_object_or_404
|
|
from osinacore.models import *
|
|
from billing.models import *
|
|
from osinacore.decorators import *
|
|
|
|
|
|
|
|
@staff_login_required
|
|
def edit_payment_method(request, method_id):
|
|
method = get_object_or_404(PaymentType, id=method_id)
|
|
if request.method == 'POST':
|
|
method.name = request.POST.get('name')
|
|
method.description = request.POST.get('description')
|
|
if request.FILES.get('image'):
|
|
method.image = request.FILES.get('image')
|
|
method.save()
|
|
return redirect('paymentmethods')
|
|
|
|
context = {
|
|
'method': method,
|
|
|
|
}
|
|
return render(request, 'edit_templates/edit-payment-method.html', context)
|
|
|
|
|
|
|
|
|
|
@staff_login_required
|
|
def edit_payment_modal(request):
|
|
|
|
context = {
|
|
|
|
}
|
|
|
|
return render(request, 'edit_templates/edit-payment-modal.html', context) |