mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #23919 -- Replaced super(ClassName, self) with super().
This commit is contained in:
@@ -28,7 +28,7 @@ class ActionAdmin(admin.ModelAdmin):
|
||||
Remove all entries named 'name' from the ModelAdmin instance URL
|
||||
patterns list
|
||||
"""
|
||||
return [url for url in super(ActionAdmin, self).get_urls() if url.name != name]
|
||||
return [url for url in super().get_urls() if url.name != name]
|
||||
|
||||
def get_urls(self):
|
||||
# Add the URL of our custom 'add_view' view to the front of the URLs
|
||||
@@ -71,8 +71,10 @@ class Car(models.Model):
|
||||
class CarAdmin(admin.ModelAdmin):
|
||||
|
||||
def response_add(self, request, obj, post_url_continue=None):
|
||||
return super(CarAdmin, self).response_add(
|
||||
request, obj, post_url_continue=reverse('admin:admin_custom_urls_car_history', args=[obj.pk]))
|
||||
return super().response_add(
|
||||
request, obj,
|
||||
post_url_continue=reverse('admin:admin_custom_urls_car_history', args=[obj.pk]),
|
||||
)
|
||||
|
||||
|
||||
site = admin.AdminSite(name='admin_custom_urls')
|
||||
|
||||
Reference in New Issue
Block a user