Commits

Anonymous committed b6280bb

Fix handling of empty session

Comments (0)

Files changed (1)

flat_forum/views.py

 
     def get_context_data(self, **kwargs):
         return dict(super(PostListView, self).get_context_data(**kwargs),
-            tag_form = forms.TagForm(initial={'tags': self.request.session['tags']}),
+            tag_form = forms.TagForm(
+                initial = {'tags': self.request.session.get('tags', [])},
+            ),
         )
 
 post_index = PostListView.as_view()