Browse Source

Add failed so I know what up.

feature/bike-tracking
Drew Larson 7 years ago
parent
commit
5732f4bdc6
  1. 2
      bikeshop_project/bike/views.py

2
bikeshop_project/bike/views.py

@ -50,7 +50,7 @@ class BikeViewSet(viewsets.ModelViewSet):
bike = get_object_or_404(Bike, pk=pk)
state = BikeState.AVAILABLE
if not can_proceed(bike.available):
raise ValidationError(detail=f'Transition from {bike.state} to {state}')
raise ValidationError(detail=f'Transition from {bike.state} to {state} failed.')
bike.available()
bike.save()

Loading…
Cancel
Save