From d0c7484370679d922dcda0b50bca21a975513533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sat, 27 Aug 2016 10:29:26 +0200 Subject: [PATCH] Adding users email --- program/migrations/0009_auto_20160827_0752.py | 20 +++++++++++++++++++ shop/admin.py | 15 +++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 program/migrations/0009_auto_20160827_0752.py diff --git a/program/migrations/0009_auto_20160827_0752.py b/program/migrations/0009_auto_20160827_0752.py new file mode 100644 index 00000000..a4b2e3f2 --- /dev/null +++ b/program/migrations/0009_auto_20160827_0752.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-08-27 07:52 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('program', '0008_auto_20160808_1747'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='days', + field=models.ManyToManyField(blank=True, to='camps.Day'), + ), + ] diff --git a/shop/admin.py b/shop/admin.py index b11459fc..9453ef3d 100644 --- a/shop/admin.py +++ b/shop/admin.py @@ -84,9 +84,22 @@ class OrderAdmin(admin.ModelAdmin): mark_order_as_refunded.description = 'Mark order(s) as refunded' +def get_user_email(obj): + return obj.order.user.email + + @admin.register(models.Ticket) class TicketModelAdmin(admin.ModelAdmin): - list_display = ['order', 'product', 'name', 'email', 'get_token', 'checked_in'] + list_display = [ + 'order', + 'product', + 'name', + 'email', + get_user_email, + 'get_token', + 'checked_in' + ] + actions = ['mark_as_arrived']