diff --git a/openedx/core/djangoapps/user_api/accounts/views.py b/openedx/core/djangoapps/user_api/accounts/views.py index 8906c35528..010b270909 100644 --- a/openedx/core/djangoapps/user_api/accounts/views.py +++ b/openedx/core/djangoapps/user_api/accounts/views.py @@ -396,11 +396,13 @@ class AccountRetirementView(ViewSet): """ try: cool_off_days = int(request.GET['cool_off_days']) - states = request.GET['states'].split(',') - if cool_off_days < 0: raise RetirementStateError('Invalid argument for cool_off_days, must be greater than 0.') + states = request.GET.getlist('states') + if not states: + raise RetirementStateError('Param "states" required with at least one state.') + state_objs = RetirementState.objects.filter(state_name__in=states) if state_objs.count() != len(states): found = [s.state_name for s in state_objs]