diff --git a/.gitignore b/.gitignore
index 7213079..2cd820c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
__pycache__/
auth.sqlite3
+.vscode/
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 1c192dc..0000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "cSpell.words": [
- "noauth",
- "noscript",
- "stylesheet",
- "tauth",
- "tcommon"
- ]
-}
diff --git a/requirements.txt b/requirements.txt
index dd361a4..863c8ef 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
-django
requests
+django
diff --git a/tauth/templates/index.html b/tauth/templates/index.html
index 9d6cbc8..1fe00e2 100644
--- a/tauth/templates/index.html
+++ b/tauth/templates/index.html
@@ -6,6 +6,7 @@
Available services:
{% if config.services.message %}- tMessage
{% endif %}
+ {% if config.services.blog %}- tBlog
{% endif %}
Log out
diff --git a/tauth/views/templates.py b/tauth/views/templates.py
index e5499cc..03a5384 100644
--- a/tauth/views/templates.py
+++ b/tauth/views/templates.py
@@ -1,9 +1,9 @@
import re
-from datetime import datetime
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.handlers.wsgi import WSGIRequest
+from django.db import IntegrityError
from django.http import HttpResponse, HttpResponseRedirect
from tauth.models import tUser
@@ -17,7 +17,7 @@ from .helper import render_template
def auth(request: WSGIRequest) -> HttpResponseRedirect:
resp = HttpResponseRedirect("/")
if "remove" in request.GET:
- resp.set_cookie("session_id", "", max_age=0, expires=datetime(0, 0, 0))
+ resp.set_cookie("session_id", "", max_age=0)
else:
resp.set_cookie("session_id", request.GET.get("sessionid") or "")
@@ -60,7 +60,7 @@ def signup(request: WSGIRequest) -> HttpResponse:
username=username,
password=password
)
- except User.DoesNotExist:
+ except IntegrityError:
error = "Username already in use"
else:
tUser.objects.create(user=u)