Commit 1184c705 authored by Muhamad's avatar Muhamad

x

parent ec5c2bb7
from django.http import response from django.http import response
from API.views import jalan from API.views import jalan
from django.contrib.auth.models import User, Group, Permission from django.contrib.auth.models import User, Group
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
# from django.views.generic import ListView, DetailView, DeleteView, UpdateView, CreateView # from django.views.generic import ListView, DetailView, DeleteView, UpdateView, CreateView
from django.views import View, generic from django.views import View, generic
...@@ -510,14 +510,10 @@ class Dashboard(generic.TemplateView): ...@@ -510,14 +510,10 @@ class Dashboard(generic.TemplateView):
} }
res_all.append(data_all) res_all.append(data_all)
perm_group = []
if request.user.is_authenticated: if request.user.is_authenticated:
current_user = request.user current_user = request.user
thisUser = current_user.id thisUser = current_user.id
for xx in request.user.get_group_permissions():
perm_group.append(xx.split(".")[1])
if thisUser == None: if thisUser == None:
user_data = {"filepath":'placeholder.jpg'} user_data = {"filepath":'placeholder.jpg'}
else: else:
...@@ -630,7 +626,6 @@ class Dashboard(generic.TemplateView): ...@@ -630,7 +626,6 @@ class Dashboard(generic.TemplateView):
'global':all[0], 'global':all[0],
'res_all':res_all, 'res_all':res_all,
'thisUser' : user_data, 'thisUser' : user_data,
'perm_group' : perm_group
# 'user_res':user_res # 'user_res':user_res
} }
return render (request, self.template_name, context) return render (request, self.template_name, context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment