diff --git a/registrasion/migrations/0026_manualpayment_entered_by.py b/registrasion/migrations/0026_manualpayment_entered_by.py new file mode 100644 index 00000000..0e068b17 --- /dev/null +++ b/registrasion/migrations/0026_manualpayment_entered_by.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-04-25 06:05 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('registrasion', '0025_auto_20160425_0411'), + ] + + operations = [ + migrations.AddField( + model_name='manualpayment', + name='entered_by', + field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + ] diff --git a/registrasion/models/commerce.py b/registrasion/models/commerce.py index cea8cc11..7e86acf2 100644 --- a/registrasion/models/commerce.py +++ b/registrasion/models/commerce.py @@ -220,6 +220,8 @@ class ManualPayment(PaymentBase): class Meta: app_label = "registrasion" + entered_by = models.ForeignKey(User) + class CreditNote(PaymentBase): ''' Credit notes represent money accounted for in the system that do not diff --git a/registrasion/views.py b/registrasion/views.py index 0d9dba23..1d357d17 100644 --- a/registrasion/views.py +++ b/registrasion/views.py @@ -669,6 +669,7 @@ def manual_payment(request, invoice_id): if request.POST and form.is_valid(): form.instance.invoice = inv + form.instance.entered_by = request.user form.save() current_invoice.update_status() form = forms.ManualPaymentForm(prefix=FORM_PREFIX)