made declined projects read only

This commit is contained in:
Oliver Zander 2025-10-17 14:18:20 +02:00
parent e9b60d7205
commit 1e075fda68
1 changed files with 7 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class ProjectAdminForm(BaseProjectForm):
super().__init__(*args, **kwargs)
for field, model in self.categories.items():
if self.initial[f'{field}_other']:
if self.initial.get(f'{field}_other'):
self.initial[field] = [*self.initial[field], model.other]
def clean(self):
@ -195,6 +195,12 @@ class ProjectRequestAdmin(BaseProjectAdmin):
class ProjectDeclinedAdmin(BaseProjectAdmin):
granted = False
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
@admin.register(BusinessCard)
class BusinessCardAdmin(RequestURLBeforeInternNotesMixin, admin.ModelAdmin):