Skip to content

Commit

Permalink
Reworked views due to bad indent
Browse files Browse the repository at this point in the history
  • Loading branch information
gpichot committed Aug 6, 2015
1 parent 79ade10 commit 74872d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion paiji2_shoutbox/templatetags/shoutbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@register.inclusion_tag(
'bulletin_board/bulletin_board_short.html',
'shoutbox/bulletin_board_short.html',
takes_context=True,
)
def display_bulletin_board(context, nb=5):
Expand Down
11 changes: 7 additions & 4 deletions paiji2_shoutbox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class NoteListView(generic.ListView):
model = Note
paginate_by = 25
context_object_name = 'notes'
template_name = 'shoutbox/note_list.html'

def get_context_data(self, **kwargs):
context = super(NoteListView, self).get_context_data(**kwargs)
Expand Down Expand Up @@ -51,6 +52,7 @@ def get_success_url(self):
class NoteEditView(generic.UpdateView):
model = Note
fields = ('message', )
template_name = 'shoutbox/note_form.html'

def dispatch(self, request, *args, **kwargs):
""" Making sure that only authors can update notes """
Expand All @@ -59,7 +61,7 @@ def dispatch(self, request, *args, **kwargs):
return HttpResponseNotFound(
_('Rezo is not hacked. You don\'t have the permission xD')
)
return super(NoteEditView, self).dispatch(request, *args, **kwargs)
return super(NoteEditView, self).dispatch(request, *args, **kwargs)

def get_success_url(self):
messages.success(
Expand All @@ -72,6 +74,7 @@ def get_success_url(self):

class NoteDeleteView(generic.DeleteView):
model = Note
template_name = 'shoutbox/note_confirm_delete.html'

def dispatch(self, request, *args, **kwargs):
""" Making sure that only authors can update notes """
Expand All @@ -80,9 +83,9 @@ def dispatch(self, request, *args, **kwargs):
return HttpResponseNotFound(
_('Rezo is not hacked. You don\'t have the permission xD')
)
return super(NoteDeleteView, self).dispatch(
request, *args, **kwargs
)
return super(NoteDeleteView, self).dispatch(
request, *args, **kwargs
)

def get_success_url(self):
messages.success(
Expand Down

0 comments on commit 74872d8

Please sign in to comment.