updated to make compatible with django 1.10

This commit is contained in:
ajurna committed 2017-01-13 11:06:37 +00:00
1 parent 9d53887b3f
commit a9ce887dcc
2 files changed
+15 -7

No files matched your search

+1 -1
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)
+14 -6
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,
'comic_auth/login.html',
{
'error': True, 'error': True,
}) })
return render(request, 'comic_auth/login.html', context)
else: 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, 'error': True,
'form': form 'form': form
}) })
return render(request, 'comic_auth/login.html', context)
else: else:
if not User.objects.all().exists(): if not User.objects.all().exists():
return redirect('/setup/') return redirect('/setup/')