jazzband/django-user-sessions

The location template tag should probably return None

danielquinn opened this issue · 2 comments

Currently, if location() fails to find anything, it returns

<i>unknown</i>

Which is problematic on two fronts:

  1. The <i> tag has been deprecated for a while in favour of <em>.

  2. It limits the user's ability to control the output. Most filters return None if nothing is available because it allows you to do stuff like this:

    {{ session.ip|locaiton|default_if_none:'Nothing found' }}

For that matter, the device template tag has similar behaviour.

I can offer a pull request if you agree with this assessment. I just didn't want to write one if you wouldn't want to use it.

Bouke commented

Seems like a valid change request, I'll welcome the PR.

Bouke commented

Fixed in adbcd55.