Browse Source

Add failed so I know what up.

feature/bike-tracking
Drew Larson 8 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) bike = get_object_or_404(Bike, pk=pk)
state = BikeState.AVAILABLE state = BikeState.AVAILABLE
if not can_proceed(bike.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.available()
bike.save() bike.save()

Loading…
Cancel
Save