Skip to content

Commit

Permalink
subscriptions admin link also working for generator class
Browse files Browse the repository at this point in the history
  • Loading branch information
newearthmartin committed Jun 10, 2024
1 parent 349a733 commit 5f07c5d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions newsletter/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ def admin_messages(self, obj):
admin_messages.short_description = ''

def admin_subscriptions(self, obj):
if obj.subscription_generator_class:
return obj.subscription_generator_class.split('.')[-1]
else:
return self._admin_url(obj, Subscription, _("Subscriptions"))
link_text = _("Subscriptions") if not obj.subscription_generator_class \
else obj.subscription_generator_class.rsplit('.', 1)[-1]
return self._admin_url(obj, Subscription, link_text)
admin_subscriptions.short_description = ''

def admin_submissions(self, obj):
Expand Down

0 comments on commit 5f07c5d

Please sign in to comment.