Skip to content

Commit

Permalink
subject class is always editable
Browse files Browse the repository at this point in the history
  • Loading branch information
Diwakar-Gupta authored Apr 2, 2024
1 parent 061ca0f commit 4f0315f
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions attendance/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,6 @@ def send_reminder(self, obj):
'<a class="button" target="_blank" disabled>Remind Absenties</a>'
)

def has_change_permission(self, request, obj=None):
from django.utils import timezone

current_time = timezone.now()

if (
obj is not None
and obj.class_end_time < current_time
and not request.user.is_superuser
):
return False
return super().has_change_permission(request, obj=obj)


admin.site.register(ProblemSolvingPercentage, ProblemSolvingPercentageAdmin)
admin.site.register(ClassAttendanceByBSM, ClassAttendanceByBSMAdmin)
Expand Down

0 comments on commit 4f0315f

Please sign in to comment.