Skip to content

Commit 66abd23

Browse files
author
abhishekram
committed
fix linter errors for admin
1 parent 1327b4b commit 66abd23

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pyas2/admin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
@admin.register(PrivateKey)
2121
class PrivateKeyAdmin(admin.ModelAdmin):
2222
"""Admin class for the PrivateKey model."""
23+
2324
form = PrivateKeyForm
2425
list_display = ("name", "valid_from", "valid_to", "serial_number", "download_key")
2526

@@ -38,6 +39,7 @@ def download_key(obj):
3839
@admin.register(PublicCertificate)
3940
class PublicCertificateAdmin(admin.ModelAdmin):
4041
"""Admin class for the PublicCertificate model."""
42+
4143
form = PublicCertificateForm
4244
list_display = ("name", "valid_from", "valid_to", "serial_number", "download_cert")
4345

@@ -56,6 +58,7 @@ def download_cert(obj):
5658
@admin.register(Partner)
5759
class PartnerAdmin(admin.ModelAdmin):
5860
"""Admin class for the Partner model."""
61+
5962
form = PartnerForm
6063
list_display = [
6164
"name",
@@ -127,7 +130,7 @@ class PartnerAdmin(admin.ModelAdmin):
127130
actions = ["send_message"]
128131

129132
@staticmethod
130-
def send_message(request, queryset):
133+
def send_message(request, queryset): # pylint: disable=W0613
131134
"""Send the message to the first partner chosen by the user."""
132135
partner = queryset.first()
133136
return HttpResponseRedirect(
@@ -140,13 +143,15 @@ def send_message(request, queryset):
140143
@admin.register(Organization)
141144
class OrganizationAdmin(admin.ModelAdmin):
142145
"""Admin class for the Organization model."""
146+
143147
list_display = ["name", "as2_name"]
144148
list_filter = ("name", "as2_name")
145149

146150

147151
@admin.register(Message)
148152
class MessageAdmin(admin.ModelAdmin):
149153
"""Admin class for the Message model."""
154+
150155
search_fields = ("message_id", "payload")
151156

152157
list_filter = ("direction", "status", "organization__as2_name", "partner__as2_name")
@@ -170,7 +175,7 @@ def mdn_url(obj):
170175
"""Return the URL to the related MDN if present for the message."""
171176
if hasattr(obj, "mdn"):
172177
view_url = reverse_lazy(
173-
f"admin:{Mdn._meta.app_label}_{Mdn._meta.model_name}_change",
178+
f"admin:{Mdn._meta.app_label}_{Mdn._meta.model_name}_change", # pylint: disable=W0212
174179
args=[obj.mdn.id],
175180
)
176181
return format_html('<a href="{}" class="">{}</a>', view_url, obj.mdn.mdn_id)
@@ -199,6 +204,7 @@ def has_add_permission(self, request):
199204
@admin.register(Mdn)
200205
class MdnAdmin(admin.ModelAdmin):
201206
"""Admin class for the Mdn model."""
207+
202208
search_fields = (
203209
"mdn_id",
204210
"message__message_id",

0 commit comments

Comments
 (0)