|
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 | | - |
24 | | -@admin.register(SentNotification) |
25 | 14 | class SentNotificationAdmin(admin.ModelAdmin): |
26 | 15 | """ |
27 | 16 | Admin for viewing historical notifications sent |
@@ -80,7 +69,7 @@ def wrapper(*args, **kwargs): |
80 | 69 | info = opts.app_label, opts.model_name |
81 | 70 |
|
82 | 71 | return [ |
83 | | - url(r"^(.+)/resend/$", wrap(self.resend_view), name="%s_%s_resend" % info), |
| 72 | + re_path(r"^(.+)/resend/$", wrap(self.resend_view), name="%s_%s_resend" % info), |
84 | 73 | ] + urls |
85 | 74 |
|
86 | 75 | @csrf_protect_m |
@@ -110,7 +99,6 @@ def resend_view( |
110 | 99 | return self.response_post_save_change(request, obj) |
111 | 100 |
|
112 | 101 |
|
113 | | -@admin.register(Notification) |
114 | 102 | class NotificationAdmin(admin.ModelAdmin): |
115 | 103 | """ |
116 | 104 | Admin for viewing/managing notifications in the system |
|
0 commit comments