Permalink
Browse files

Merge pull request #3 from FrancoAA/master

login bug fix
  • Loading branch information...
2 parents 2880a6d + 10f56cf commit 2402870957d56db87ac3b00023b95a0ec9e0bec9 @peterkuma committed Oct 3, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 fileshack/views.py
View
@@ -100,6 +100,9 @@ def login_wrapper(request, *args, **kwargs):
def logout(request, store):
try:
request.session["fileshack_stores"].remove(store.id)
+ # FIX: we should call session.save() because django session system doesn't track
+ # the changes made inside of the list
+ request.session.save()
except (KeyError, ValueError):
pass
request.session.save()
@@ -117,7 +120,10 @@ def index(request, store):
if not request.session.has_key("fileshack_stores"):
request.session["fileshack_stores"] = [store.id]
else:
- request.session["fileshack_stores"].append(store.id)
+ request.session["fileshack_stores"].append(store.id)
+ # FIX: we should call session.save() because django session system doesn't track
+ # the changes made inside of the list
+ request.session.save()
return HttpResponseRedirect(store.get_absolute_url())
else:
t = loader.get_template("fileshack/accesscode.html")

0 comments on commit 2402870

Please sign in to comment.