Skip to content

Commit

Permalink
SSO_PROFILES :: Fix : Fix api for Python3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
KGuillemot committed Jun 9, 2020
1 parent 3919a33 commit 532de34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/views/sso_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def post(self, request, app_id, login=""):
# And verify if all fields are provided
request_data = request.POST or request.JSON
new_sso_profiles = {}
unknown_fields = request_data.keys()
unknown_fields = list(request_data.keys())
for sso_profile_app in sso_profiles_app:
if sso_profile_app['type'] in ("learn", "learn_secret"):
field_name = sso_profile_app['name'].split(';vlt;')[0]
Expand All @@ -140,7 +140,7 @@ def post(self, request, app_id, login=""):
if len(unknown_fields) == 1:
unknown_fields = unknown_fields.pop()
else:
unknown_fields = ",".join(list(unknown_fields))
unknown_fields = ",".join(unknown_fields)
raise Exception("Field(s) '{}' not found in Application learning fields.".format(unknown_fields))

app.set_sso_profiles(login, new_sso_profiles)
Expand Down Expand Up @@ -187,7 +187,7 @@ def put(self, request, app_id, login=""):
# Retrieve the list of application sso_profiles
sso_profiles_app = json_loads(app.sso_profile)
# And verify if all fields are provided
unknown_fields = request_data.keys()
unknown_fields = list(request_data.keys())
new_sso_profiles = {}
for sso_profile_app in sso_profiles_app:
if sso_profile_app['type'] in ("learn", "learn_secret"):
Expand Down

0 comments on commit 532de34

Please sign in to comment.