diff --git a/S1/waitinglists/admin.py b/S1/waitinglists/admin.py index c0df42c..4399bf4 100644 --- a/S1/waitinglists/admin.py +++ b/S1/waitinglists/admin.py @@ -6,7 +6,10 @@ class SessionAdmin(admin.ModelAdmin): - readonly_fields = ("attendance_done", "open_signup") + def get_readonly_fields(self, request, obj=None): + if request.user.groups.filter(name="Mentor").exists(): + return ("attendance_done", "open_signup") + return super().get_readonly_fields(request, obj) def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == "mentor":