mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Many right fix on counters
This commit is contained in:
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user