1👍
✅
I’m not exactly sure what you are doing here, but it sounds like you just need to check that city
is actually supplied before setting it.
city = request.GET.get('city')
if city:
request.session['city'] = city
Source:stackexchange.com