Commit cbd2b932 authored by Samuel GAIST's avatar Samuel GAIST Committed by Samuel GAIST

[admin] Fix has_add_permission

Support for InlineModelAdmin.has_add_permission() methods
that don't accept obj as the second positional argument
was deprecated in Django 2.1 and removed in Django 3.0.

See:

https://code.djangoproject.com/ticket/31098
parent eb2e9d80
Pipeline #42631 passed with stage
in 15 minutes and 43 seconds
......@@ -192,7 +192,7 @@ class JobSplitInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -210,7 +210,7 @@ class Job(admin.ModelAdmin):
def splits(self, obj):
return obj.splits.count()
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......
......@@ -229,7 +229,7 @@ class DatabaseSetTemplateOutputInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -245,7 +245,7 @@ class DatabaseSetTemplate(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -265,7 +265,7 @@ class DatabaseSetOutputInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -286,7 +286,7 @@ class DatabaseSet(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......
......@@ -133,7 +133,7 @@ class BlockInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -268,7 +268,7 @@ class BlockInputInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -291,7 +291,7 @@ class CachedFileInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -328,7 +328,7 @@ class BlockDependentsInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -365,7 +365,7 @@ class BlockDependenciesInline(admin.TabularInline):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -457,7 +457,7 @@ class Block(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
form = BlockModelForm
......@@ -505,7 +505,7 @@ class Result(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......@@ -640,7 +640,7 @@ class CachedFile(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
def has_add_permission(self, request, obj=None):
return False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment