natethelen/django-flatblocks — pull request #2 by nskeip (2012-06-18 04:32:29+00:00)
Title: LocaleMiddleware not required

Hi!

In ``flatblocks/template_tags/flatblock_tags.py`` we got the following code:

```python
lang = settings.LANGUAGE_CODE

if 'django.middleware.locale.LocaleMiddleware' not in settings.MIDDLEWARE_CLASSES:
logger.warning("For i18n support in flatblocks you must have django.middleware.locale.LocaleMiddleware in your MIDDLEWARE_CLASSES")
else:
lang = get_language()
```

Well, it is rather nice to recieve a warnging like that, but for those who have a custom middleware instead of django.middleware.locale.LocaleMiddleware it is a problem - for example, I use Django CMS and it requires me not to use LocaleMiddleware as it gives me some other middleware.

I removed this if-statement and ``lang = settings.LANGUAGE_CODE`` that is redundant (because ``get_language`` is smart enough to use ``settings.LANGUAGE_CODE`` in case current language not set via middleware).