suggested replacement:
```python
if request.GET.get('lang'):
```
That way a url like /?lang=&dude=abides won't cause the middleware to ignore the Accept-Language header.