Many right fix on counters

This commit is contained in:
Skia
2017-01-04 19:39:37 +01:00
parent 114272df2f
commit 72685618a6
3 changed files with 9 additions and 7 deletions

View File

@ -161,7 +161,7 @@ class Counter(models.Model):
return user.is_in_group(settings.SITH_GROUP_COUNTER_ADMIN_ID)
def can_be_viewed_by(self, user):
if self.type == "BAR" or self.type == "EBOUTIC":
if self.type == "BAR":
return True
return user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user in self.sellers.all()

View File

@ -90,7 +90,7 @@ class CounterTabsMixin(TabedViewMixin):
})
return tab_list
class CounterMain(CounterTabsMixin, DetailView, ProcessFormView, FormMixin):
class CounterMain(CounterTabsMixin, CanViewMixin, DetailView, ProcessFormView, FormMixin):
"""
The public (barman) view
"""
@ -148,7 +148,7 @@ class CounterMain(CounterTabsMixin, DetailView, ProcessFormView, FormMixin):
def get_success_url(self):
return reverse_lazy('counter:click', args=self.args, kwargs=self.kwargs)
class CounterClick(CounterTabsMixin, DetailView):
class CounterClick(CounterTabsMixin, CanViewMixin, DetailView):
"""
The click view
This is a detail view not to have to worry about loading the counter