don't crash on calls missing a next_url info
This commit is contained in:
parent
35851aba47
commit
3622d54cf2
|
@ -35,6 +35,8 @@ def is_coming_for(request):
|
||||||
'{urn:oasis:names:tc:SAML:2.0:protocol}Extensions/{https://www.entrouvert.com/}next_url')[0].text
|
'{urn:oasis:names:tc:SAML:2.0:protocol}Extensions/{https://www.entrouvert.com/}next_url')[0].text
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
return 'unknown'
|
return 'unknown'
|
||||||
|
if not next_url:
|
||||||
|
return 'unknown'
|
||||||
target_path = urlparse.urlparse(next_url).path
|
target_path = urlparse.urlparse(next_url).path
|
||||||
for prefix in ('manage', 'admin', 'backoffice'):
|
for prefix in ('manage', 'admin', 'backoffice'):
|
||||||
if target_path.startswith('/%s/' % prefix):
|
if target_path.startswith('/%s/' % prefix):
|
||||||
|
|
Reference in New Issue