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 # Requirments
- [Django 1.9](https://www.djangoproject.com/) - [Django 1.10](https://www.djangoproject.com/)
- [python 3.5](https://www.python.org/) - [python 3.5](https://www.python.org/)
- [rarfile python library by Marko Kreen](https://github.com/markokr/rarfile) (included) - [rarfile python library by Marko Kreen](https://github.com/markokr/rarfile) (included)
- [Unrar by winrar](http://rarlabs.com) - [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 import authenticate, login, logout
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from comic_auth.forms import LoginForm from comic_auth.forms import LoginForm
@@ -19,17 +19,25 @@ def comic_login(request):
else: else:
return redirect('/comic/') return redirect('/comic/')
else: else:
context = RequestContext(request, { return render(request,
'error': True, 'comic_auth/login.html',
{
}) 'error': True,
return render(request, 'comic_auth/login.html', context) })
else:
return render(request,
'comic_auth/login.html',
{
'error': True,
'form': form
})
else: else:
context = RequestContext(request, { return render(request,
'error': True, 'comic_auth/login.html',
'form': form {
}) 'error': True,
return render(request, 'comic_auth/login.html', context) 'form': form
})
else: else:
if not User.objects.all().exists(): if not User.objects.all().exists():
return redirect('/setup/') return redirect('/setup/')