diff --git a/store/admin.py b/store/admin.py index 02e820f9..2fc55557 100644 --- a/store/admin.py +++ b/store/admin.py @@ -169,6 +169,7 @@ class OrderLineAdmin(SimpleHistoryAdmin, ExportActionModelAdmin): CouponFilter, 'quantity', OrderUserFilter, + 'order__transaction_date', ) search_fields = [ 'order__user__email', diff --git a/store/resources.py b/store/resources.py index 6b719283..30d7dbc0 100644 --- a/store/resources.py +++ b/store/resources.py @@ -100,7 +100,11 @@ class OrderLineResource(resources.ModelResource): def dehydrate_item_name(self, orderline): model = get_model_from_name(orderline.content_type.model) - return model.objects.get(id=orderline.object_id).name + try: + name = model.objects.get(id=orderline.object_id).name + except AttributeError: + name = model._meta.verbose_name.title() + return name def dehydrate_item_id(self, orderline): model = get_model_from_name(orderline.content_type.model)