diff --git a/core/apps/accounts/permissions.py b/core/apps/accounts/permissions.py index 9d6e684..5283faa 100644 --- a/core/apps/accounts/permissions.py +++ b/core/apps/accounts/permissions.py @@ -6,11 +6,6 @@ from core.apps.accounts.choices import RoleChoice class IsAdminRole(BasePermission): def has_permission(self, request, view): - if not request.user.is_authenticated: - return False - - if request.user.role not in [RoleChoice.ADMIN ,RoleChoice.SUPERUSER]: - raise PermissionDenied("Only admin can access this") - return True - - + if request.user and request.user.role in [RoleChoice.ADMIN, RoleChoice.SUPERUSER]: + return True + return False diff --git a/core/apps/evaluation/migrations/0049_merge_20260506_1715.py b/core/apps/evaluation/migrations/0049_merge_20260506_1715.py deleted file mode 100644 index 60cb17d..0000000 --- a/core/apps/evaluation/migrations/0049_merge_20260506_1715.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 5.2.7 on 2026-05-06 12:15 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("evaluation", "0047_autoevaluationmodel_tender_contract_date_and_more"), - ("evaluation", "0048_autoevaluation_customer_fields"), - ] - - operations = []