darklow / django-suit

Modern theme for Django admin interface
http://djangosuit.com/
Other
2.33k stars 704 forks source link

Missing Left Menu when using django channels #495

Open andpozo opened 8 years ago

andpozo commented 8 years ago

When use django channels, the request is an instance of AsgiRequest, so the condition in /darklow/django-suit/blob/develop/suit/templatetags/suit_menu.py#L26/ produces an empty left menu, could be replaced with:

if not isinstance(request, http.HttpRequest):
    return None

or:

if not isinstance(request, (WSGIRequest, AsgiRequest)):
   return None

that makes sense?

darklow commented 8 years ago

Sure, it makes sense, just 2 days ago I did exactly same for v2 branch https://github.com/darklow/django-suit/commit/ddb449aa2edc25e6f9cebe76e870fff2f7e1738f as I am using django channels too, just with upcoming v2: https://github.com/darklow/django-suit/issues/475. Will fix shortly.

SashaBorandi commented 8 years ago

It is possible for bs3 branch?

darklow commented 8 years ago

@SashaBorandi The fix exactly the same as for v2: https://github.com/darklow/django-suit/commit/ddb449aa2edc25e6f9cebe76e870fff2f7e1738f Feel free to make a PR for bs3 branch.