Convert string object to dict
This commit is contained in:
parent
617f46835e
commit
e97d82c6f0
1 changed files with 7 additions and 1 deletions
|
@ -45,6 +45,7 @@ from helpers import (
|
||||||
AppRole
|
AppRole
|
||||||
)
|
)
|
||||||
|
|
||||||
|
import ast
|
||||||
# This is a circular import and should be solved differently
|
# This is a circular import and should be solved differently
|
||||||
#from app import db
|
#from app import db
|
||||||
from database import db
|
from database import db
|
||||||
|
@ -235,7 +236,12 @@ def consent():
|
||||||
# Get information about this consent request:
|
# Get information about this consent request:
|
||||||
# False positive: pylint: disable=no-member
|
# False positive: pylint: disable=no-member
|
||||||
try:
|
try:
|
||||||
consent_client = consent_request.client.get('client_id')
|
consent_client = consent_request.client
|
||||||
|
|
||||||
|
# Some versions of Hydra module return a string object and need to be decoded
|
||||||
|
if isinstance(consent_client, str):
|
||||||
|
consent_client = ast.literal_eval(consent_client)
|
||||||
|
|
||||||
app_id = consent_client.get('client_id')
|
app_id = consent_client.get('client_id')
|
||||||
# False positive: pylint: disable=no-member
|
# False positive: pylint: disable=no-member
|
||||||
kratos_id = consent_request.subject
|
kratos_id = consent_request.subject
|
||||||
|
|
Loading…
Reference in a new issue