Skip to content
Snippets Groups Projects
Commit 12d5c9b2 authored by Renzo Lucioni's avatar Renzo Lucioni
Browse files

Do not call upper on a profile country code of None

parent 80a0744e
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,7 @@ class EmbargoMiddleware(object):
profile_country = cache.get(cache_key)
if profile_country is None:
profile = getattr(user, 'profile', None)
if profile is not None and profile.country is not None:
if profile is not None and profile.country.code is not None:
profile_country = profile.country.code.upper()
else:
profile_country = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment