Exemplo n.º 1
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     context['acceptance_transition_id'] = ACCEPTANCE_TRANSITION_ID
     context['acceptance_transition_exists'] = acceptance_transition_exists()  # noqa: E501
     context['assets_to_accept'] = get_assets_to_accept(self.request.user)
     context['loan_transition_id'] = ACCEPTANCE_LOAN_TRANSITION_ID
     context['loan_transition_exists'] = loan_transition_exists()
     context['assets_to_loan'] = get_assets_to_accept_loan(self.request.user)  # noqa: E501
     return context
Exemplo 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),
    }