From e7bdbe6846da7cfac089359b24dd8072df7635a6 Mon Sep 17 00:00:00 2001 From: John Eskew Date: Sun, 29 Apr 2018 10:43:36 -0400 Subject: [PATCH] Process states param to gather all passed-in states. --- openedx/core/djangoapps/user_api/accounts/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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]