diff --git a/reValuate/db.sqlite3 b/reValuate/db.sqlite3 index 3c29c38d..1f439944 100644 Binary files a/reValuate/db.sqlite3 and b/reValuate/db.sqlite3 differ diff --git a/reValuate/home/__pycache__/views.cpython-38.pyc b/reValuate/home/__pycache__/views.cpython-38.pyc index 86592886..6efcb682 100644 Binary files a/reValuate/home/__pycache__/views.cpython-38.pyc and b/reValuate/home/__pycache__/views.cpython-38.pyc differ diff --git a/reValuate/home/views.py b/reValuate/home/views.py index ff809b83..18728401 100644 --- a/reValuate/home/views.py +++ b/reValuate/home/views.py @@ -7,12 +7,19 @@ from django.conf import settings def homePage(request): iter_var = 0 all_balance = [] - + Cashier = False + Processor = False try: balObject = Balance.objects.filter(user=request.user.id) userBalance = balObject.values("balanceValue") userQR = f"Name = {request.user.username}, Date Joined = {request.user.date_joined.date()}, ID = {request.user.id}, Balance = {userBalance[0]['balanceValue']}" + if request.user.groups.filter(name='Cashier').exists(): + Cashier = True + elif request.user.groups.filter(name='Processor').exists(): + Processor = True + else: + pass a = Balance.objects.all() for user in a: @@ -20,6 +27,8 @@ def homePage(request): print(f"{all_balance}") limited_coins = settings.ALL_COINS - sum(all_balance) context = { + "isCashier": Cashier, + "isProcessor": Processor, "userQR":userQR, "fullbalance": limited_coins, "currencyTotal": sum(all_balance), diff --git a/reValuate/templates/adminView.html b/reValuate/templates/adminView.html index 514385c3..f146ae04 100644 --- a/reValuate/templates/adminView.html +++ b/reValuate/templates/adminView.html @@ -42,7 +42,6 @@ {% block content %}
-{% if request.user.is_superuser %} {% if image %}
@@ -83,12 +82,7 @@
-{% else %} -

Unauthorized

- - -{% endif %} {% endblock %} diff --git a/reValuate/templates/home.html b/reValuate/templates/home.html index e1a7a36b..a0a90e67 100644 --- a/reValuate/templates/home.html +++ b/reValuate/templates/home.html @@ -34,13 +34,18 @@ {% endif %} + + {% if isProcessor %} {% endif %} - + {% if isCashier %} + + {% endif %}