Remove useless mixin

This commit is contained in:
Skia 2016-09-29 12:53:09 +02:00
parent 2e7e78b8ce
commit c2276dab2b

View File

@ -87,14 +87,7 @@ class CounterTabsMixin(TabedViewMixin):
}) })
return tab_list return tab_list
class CheckTokenMixin: class CounterMain(CounterTabsMixin, DetailView, ProcessFormView, FormMixin):
def post(self, request, *args, **kwargs):
if not ('counter_token' in self.request.session.keys() and self.request.session['counter_token'] == self.object.token):
return HttpResponseRedirect(reverse_lazy('counter:details', args=self.args,
kwargs={'counter_id': self.object.id})+'?bad_location')
return super(CheckTokenMixin, self).post(request, *args, **kwargs)
class CounterMain(CounterTabsMixin, DetailView, CheckTokenMixin, ProcessFormView, FormMixin):
""" """
The public (barman) view The public (barman) view
""" """
@ -152,7 +145,7 @@ class CounterMain(CounterTabsMixin, DetailView, CheckTokenMixin, ProcessFormView
def get_success_url(self): def get_success_url(self):
return reverse_lazy('counter:click', args=self.args, kwargs=self.kwargs) return reverse_lazy('counter:click', args=self.args, kwargs=self.kwargs)
class CounterClick(CounterTabsMixin, DetailView, CheckTokenMixin): class CounterClick(CounterTabsMixin, DetailView):
""" """
The click view The click view
This is a detail view not to have to worry about loading the counter This is a detail view not to have to worry about loading the counter