mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Add logs and block for templates
This commit is contained in:
parent
55e93a9087
commit
5960e94da5
35 changed files with 183 additions and 29 deletions
|
|
@ -1,4 +1,6 @@
|
|||
from django.shortcuts import render
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
|
|
@ -8,6 +10,12 @@ def users(request):
|
|||
:return:
|
||||
"""
|
||||
|
||||
if not request.user.is_authenticated():
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
if not request.user.is_superuser:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
users = User.objects.filter(is_staff=False, is_superuser=False)
|
||||
|
||||
return render(request, 'users.html', locals())
|
||||
|
|
@ -18,6 +26,12 @@ def user(request, user_id):
|
|||
:return:
|
||||
"""
|
||||
|
||||
if not request.user.is_authenticated():
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
if not request.user.is_superuser:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
user = User.objects.get(id=user_id)
|
||||
|
||||
return render(request, 'user.html', locals())
|
||||
Loading…
Add table
Add a link
Reference in a new issue