débug
This commit is contained in:
@@ -29,15 +29,16 @@ class _cl_Student_eval_admin(admin.ModelAdmin):
|
||||
|
||||
|
||||
search_fields = ['sStudent', 'sRef']
|
||||
list_filter = ['sStudent',"sAuthor", "nEval_Type", "nEval_Mode", ('dtDate', DateRangeFilter)]
|
||||
list_filter = ['sStudent',"sAuthor", "nEval_Type", "nEval_Mode"]
|
||||
|
||||
def get_form(self, request, obj=None, **kwargs):
|
||||
user_obj = request.user
|
||||
author_id = obj.Author.id if obj.Author is not None else 0
|
||||
student_id = obj.Student.id if obj.Student is not None else 0
|
||||
if obj is not None:
|
||||
author_id = obj.Author.id if obj.Author is not None else 0
|
||||
student_id = obj.Student.id if obj.Student is not None else 0
|
||||
|
||||
if not user_obj.id == author_id and not user_obj.id == student_id and not is_member(user_obj, "FI-Encadrants"):
|
||||
raise PermissionDenied
|
||||
if not user_obj.id == author_id and not user_obj.id == student_id and not is_member(user_obj, "FI-Encadrants"):
|
||||
raise PermissionDenied
|
||||
return super().get_form(request, obj, **kwargs)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user