Skip to content

Commit

Permalink
Merge pull request #2130 from FJNR-inc/develop
Browse files Browse the repository at this point in the history
new release
  • Loading branch information
MelanieFJNR authored Nov 2, 2023
2 parents 7295f17 + fa26f74 commit d7f890c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions store/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class OrderLineAdmin(SimpleHistoryAdmin, ExportActionModelAdmin):
CouponFilter,
'quantity',
OrderUserFilter,
'order__transaction_date',
)
search_fields = [
'order__user__email',
Expand Down
6 changes: 5 additions & 1 deletion store/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d7f890c

Please sign in to comment.