summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-04-05 23:14:13 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-04-05 23:14:13 +0200
commit5326dc2d0a16dd7990b5608bb6fcfdf25543a94c (patch)
treee2614b3a37c560bac3aa2bb11d56342c9744cf1e
parente57700de5bd7e1be1913489101344a96c888c3f5 (diff)
downloadmarks-5326dc2d0a16dd7990b5608bb6fcfdf25543a94c.tar.gz
marks-5326dc2d0a16dd7990b5608bb6fcfdf25543a94c.tar.bz2
* Add view to reset the session data
-rw-r--r--main/views.py13
-rw-r--r--urls.py1
2 files changed, 12 insertions, 2 deletions
diff --git a/main/views.py b/main/views.py
index 1e43b4a..7ea5565 100644
--- a/main/views.py
+++ b/main/views.py
@@ -17,8 +17,17 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
-from marks.main.shared import redirect, render_page, render_template
+from marks.main.shared import redirect, render_page, render_template, \
+ get_user_data
def home_view (request):
'''Render the main page'''
- return render_page (request, {}, "main/home.html")
+ data = {
+ }
+ return render_page (request, data, "main/home.html")
+
+def reset_view (request):
+ '''Free user data'''
+ if "user_data" in request.session:
+ del request.session["user_data"]
+ return redirect (request, "/", "Session was successfully reset.")
diff --git a/urls.py b/urls.py
index 22f2888..72b3857 100644
--- a/urls.py
+++ b/urls.py
@@ -21,4 +21,5 @@ from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^$', 'marks.main.views.home_view'),
+ (r'^reset$', 'marks.main.views.reset_view'),
)