updated to make compatible with django 1.10

This commit is contained in:
2017-01-13 11:06:37 +00:00
parent 9d53887b3f
commit a9ce887dcc
2 changed files with 20 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ This is for if you have a collection of comics on a media server and want to rea
# Requirments
- [Django 1.9](https://www.djangoproject.com/)
- [Django 1.10](https://www.djangoproject.com/)
- [python 3.5](https://www.python.org/)
- [rarfile python library by Marko Kreen](https://github.com/markokr/rarfile) (included)
- [Unrar by winrar](http://rarlabs.com)

View File

@@ -1,6 +1,6 @@
from django.shortcuts import render, redirect, RequestContext
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from comic_auth.forms import LoginForm
@@ -19,17 +19,25 @@ def comic_login(request):
else:
return redirect('/comic/')
else:
context = RequestContext(request, {
return render(request,
'comic_auth/login.html',
{
'error': True,
})
return render(request, 'comic_auth/login.html', context)
else:
context = RequestContext(request, {
return render(request,
'comic_auth/login.html',
{
'error': True,
'form': form
})
else:
return render(request,
'comic_auth/login.html',
{
'error': True,
'form': form
})
return render(request, 'comic_auth/login.html', context)
else:
if not User.objects.all().exists():
return redirect('/setup/')