Skip to content
Snippets Groups Projects
Commit 99a79aac authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

fix: Handle missing HTTP_USER_AGENT in request

parent 042f0ae8
No related branches found
No related tags found
No related merge requests found
......@@ -66,10 +66,11 @@ def index(request):
# Serving settings for JavaScript
def settings_js(request):
user_agent = request.META['HTTP_USER_AGENT']
user_agent = request.META.get('HTTP_USER_AGENT', None)
user_is_ie = False
if user_agent.find("MSIE") >= 0 or user_agent.find("Trident") >= 0:
user_is_ie = True
if user_agent is not None:
if user_agent.find("MSIE") >= 0 or user_agent.find("Trident") >= 0:
user_is_ie = True
context = {
'crop_categories': CropCategory.get_crop_categories_from_vipslogic_as_text(),
'user_is_ie': user_is_ie,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment