Merge pull request 'behruz' (#150) from behruz into main
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 1m12s
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 1m12s
Reviewed-on: #150
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = []
|
||||
Reference in New Issue
Block a user