|
3 | 3 | """ |
4 | 4 |
|
5 | 5 | from functools import update_wrapper |
6 | | - |
7 | | -try: |
8 | | - from django.urls import re_path as url |
9 | | -except ImportError: |
10 | | - from django.conf.urls import url |
11 | | - |
12 | 6 | from django.contrib import admin, messages |
13 | 7 | from django.contrib.admin.options import csrf_protect_m |
14 | 8 | from django.contrib.admin.utils import unquote |
15 | | -from django.urls import reverse |
| 9 | +from django.urls import re_path, reverse |
16 | 10 | from django.utils.safestring import mark_safe |
17 | 11 |
|
18 | | -from herald.utils import get_sent_notification_model |
19 | 12 | from .models import Notification |
20 | 13 |
|
21 | | -SentNotification = get_sent_notification_model() |
22 | | - |
23 | 14 |
|
24 | | -@admin.register(SentNotification) |
25 | 15 | class SentNotificationAdmin(admin.ModelAdmin): |
26 | 16 | """ |
27 | 17 | Admin for viewing historical notifications sent |
@@ -80,7 +70,9 @@ def wrapper(*args, **kwargs): |
80 | 70 | info = opts.app_label, opts.model_name |
81 | 71 |
|
82 | 72 | return [ |
83 | | - url(r"^(.+)/resend/$", wrap(self.resend_view), name="%s_%s_resend" % info), |
| 73 | + re_path( |
| 74 | + r"^(.+)/resend/$", wrap(self.resend_view), name="%s_%s_resend" % info |
| 75 | + ), |
84 | 76 | ] + urls |
85 | 77 |
|
86 | 78 | @csrf_protect_m |
@@ -110,7 +102,6 @@ def resend_view( |
110 | 102 | return self.response_post_save_change(request, obj) |
111 | 103 |
|
112 | 104 |
|
113 | | -@admin.register(Notification) |
114 | 105 | class NotificationAdmin(admin.ModelAdmin): |
115 | 106 | """ |
116 | 107 | Admin for viewing/managing notifications in the system |
|
0 commit comments