Browse Source

[Fix] `/opt/jumpserver/apps/jumpserver/views/index.py redirect(assets:user-asset-list)` (#4121)

pull/4129/head
xinwen 4 years ago committed by GitHub
parent
commit
1d640eccf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      apps/jumpserver/views/index.py

15
apps/jumpserver/views/index.py

@ -1,5 +1,4 @@
from django.views.generic import TemplateView
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import redirect
from common.permissions import PermissionsMixin, IsValidUser
@ -12,17 +11,3 @@ class IndexView(PermissionsMixin, TemplateView):
def get(self, request, *args, **kwargs):
return redirect('/ui/')
def dispatch(self, request, *args, **kwargs):
if not request.user.is_authenticated:
return self.handle_no_permission()
if request.user.is_common_user:
return redirect('assets:user-asset-list')
return super(IndexView, self).dispatch(request, *args, **kwargs)
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({
'app': _("Dashboard"),
})
return context

Loading…
Cancel
Save