Skip to content

Commit

Permalink
added permission denied for non super user
Browse files Browse the repository at this point in the history
  • Loading branch information
oyeniyipa committed Nov 14, 2024
1 parent 85e195a commit 667cd5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/views.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.shortcuts import render


@login_required
def index(request):
if not request.user.is_superuser:
raise PermissionDenied
return render(request, "core/base.html")


Expand Down

0 comments on commit 667cd5e

Please sign in to comment.