Merge pull request 'behruz' (#150) from behruz into main
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 1m12s

Reviewed-on: #150
This commit is contained in:
2026-05-06 13:04:22 +00:00
2 changed files with 3 additions and 21 deletions

View File

@@ -6,11 +6,6 @@ from core.apps.accounts.choices import RoleChoice
class IsAdminRole(BasePermission): class IsAdminRole(BasePermission):
def has_permission(self, request, view): def has_permission(self, request, view):
if not request.user.is_authenticated: if request.user and request.user.role in [RoleChoice.ADMIN, RoleChoice.SUPERUSER]:
return False return True
return False
if request.user.role not in [RoleChoice.ADMIN ,RoleChoice.SUPERUSER]:
raise PermissionDenied("Only admin can access this")
return True

View File

@@ -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 = []