mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2025-06-29 16:21:03 +02:00
Destroy Django 1.11 functions
This commit is contained in:
@ -40,16 +40,17 @@ def retour_emprunt(request, empruntid):
|
||||
return redirect("admin:media_emprunt_changelist")
|
||||
|
||||
|
||||
def index(request):
|
||||
class IndexView(TemplateView):
|
||||
"""
|
||||
Home page which redirect to admin when logged in
|
||||
"""
|
||||
if request.user.is_authenticated:
|
||||
return redirect('admin:index')
|
||||
else:
|
||||
return render(request, 'admin/index.html', {
|
||||
'title': _('Welcome to the Mediatek database'),
|
||||
})
|
||||
extra_context = {'title': _('Welcome to the Mediatek database')}
|
||||
template_name = 'admin/index.html'
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if request.user.is_authenticated:
|
||||
return redirect('admin:index')
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
||||
|
||||
class FindMediumView(LoginRequiredMixin, TemplateView):
|
||||
|
Reference in New Issue
Block a user