diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-23 14:41:38 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-23 14:41:38 +0200 |
commit | 30114f34e87eeeb37ecac3176e6fff62519ebb6e (patch) | |
tree | d14b2e7f3977ba9c1944394d2b07c633862daf54 /module/web | |
parent | extern cnl (diff) | |
download | pyload-30114f34e87eeeb37ecac3176e6fff62519ebb6e.tar.xz |
better django compatbility
Diffstat (limited to 'module/web')
-rw-r--r-- | module/web/pyload/templatetags/token.py | 13 | ||||
-rw-r--r-- | module/web/templates/default/login.html | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/module/web/pyload/templatetags/token.py b/module/web/pyload/templatetags/token.py new file mode 100644 index 000000000..fc190db73 --- /dev/null +++ b/module/web/pyload/templatetags/token.py @@ -0,0 +1,13 @@ + +from django import VERSION +from django import template +register = template.Library() + +if VERSION[:3] < (1,1,2): + + @register.tag() + def csrf_token(): + """ + Return nothing, since csrf is deactivated in django 1.1 + """ + return "" diff --git a/module/web/templates/default/login.html b/module/web/templates/default/login.html index f4b0a5560..7ae78183b 100644 --- a/module/web/templates/default/login.html +++ b/module/web/templates/default/login.html @@ -1,5 +1,6 @@ {% extends 'default/base.html' %} {% load i18n %} +{% load token %} {% block title %}{% trans "Login" %} - {{block.super}} {% endblock %} @@ -7,6 +8,7 @@ <div class="centeralign"> <form action="" method="post" accept-charset="utf-8" id="login"> + {% csrf_token %} <div class="no"> <input type="hidden" name="do" value="login" /> <fieldset> |