Exemplo n.º 1
0
 def get_template_names(self):
     user = self.request.user
     user = user if not hasattr(user, 'user') else user.user
     can_create_order = user.has_perm('orders_manager.add_order')
     if is_mobile_browser(self.request) and can_create_order:
         return 'orders_manager/mobile/index.html'
     else:
         return 'orders_manager/list_order.html'
Exemplo n.º 2
0
 def dispatch(self, request, *args, **kwargs):
     if is_mobile_browser(request):
         pass
     return super(ShowAllOrdersListView, self).dispatch(request, *args,
                                                        **kwargs)