Skip to content

Commit

Permalink
Merge pull request #208 from readthedocs/davidfischer/fix-bug-publish…
Browse files Browse the repository at this point in the history
…er-cache-timeout

Fix a bug around clicking an add after 4 hours
  • Loading branch information
davidfischer committed Jul 28, 2020
2 parents bf7a5b1 + 7b0aa87 commit 6f354f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion adserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,13 @@ def send_to_analytics(self, request, advertisement, message):
def get_response(self, request, advertisement, publisher):
# Allows using variables in links such as `?utm_source=${publisher}`
template = string.Template(advertisement.link)

publisher_slug = "unknown"
if publisher:
publisher_slug = publisher.slug

url = template.safe_substitute(
publisher=publisher.slug, advertisement=advertisement.slug
publisher=publisher_slug, advertisement=advertisement.slug
)
return HttpResponseRedirect(url)

Expand Down

0 comments on commit 6f354f7

Please sign in to comment.