diff --git a/src/authentic2_gnm/templatetags/gnm.py b/src/authentic2_gnm/templatetags/gnm.py index 54b89c3..7887c33 100644 --- a/src/authentic2_gnm/templatetags/gnm.py +++ b/src/authentic2_gnm/templatetags/gnm.py @@ -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 except (KeyError, IndexError): return 'unknown' + if not next_url: + return 'unknown' target_path = urlparse.urlparse(next_url).path for prefix in ('manage', 'admin', 'backoffice'): if target_path.startswith('/%s/' % prefix):