Esempio n. 1
0
 def post(self, request, *args, **kwargs):
     action = request.POST['action']
     if action == 'accept':
         acceptance_url = get_acceptance_url(request.user)
     else:
         acceptance_url = get_loan_acceptance_url(request.user)
     if acceptance_url:
         return HttpResponseRedirect(acceptance_url)
     return super().get(request, *args, **kwargs)
Esempio n. 2
0
def get_user_equipment_to_accept_tile_data(user):
    assets_to_accept_count = get_assets_to_accept(user).count()
    if not assets_to_accept_count:
        return None
    return {
        'class': 'equipment-to-accept',
        'label': _('Hardware pick up'),
        'count': assets_to_accept_count,
        'url': get_acceptance_url(user),
    }