indeedeng / django-ptrack

Tracking pixel library for Django
Apache License 2.0
40 stars 17 forks source link

Allow empty string settings.PTRACK_APP_URL #5

Open thenewguy opened 6 years ago

thenewguy commented 6 years ago

I handle url normalization with a post processor. It would be handy if PTRACK_APP_URL could be an empty string.

Not a lot of work but I had to do this:

def rel_ptrack_tag(*args, **kwargs):
    encoded_dict = {'ptrack_encoded_data': ptrack_encoder.encrypt(*args, **kwargs)}
    url = reverse('ptrack', kwargs=encoded_dict)
    return mark_safe("<img src='%s' width=1 height=1>" % (url,))