Skip to content

Commit

Permalink
Merge pull request #37 from georgebrock/fix-past-substandards-locations
Browse files Browse the repository at this point in the history
Fix some event metadata
  • Loading branch information
russss authored Sep 12, 2024
2 parents 135713f + 4203029 commit fd2065f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions ps_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ def __init__(self, data={}, date=None, manual=False):
v = datetime.datetime.strptime(v, "%H:%M").time()
setattr(self, k, v)

for venue in VENUES:
if venue.from_date < self.date.date() and (venue.until_date is None or venue.until_date > self.date.date()):
self.location = venue.name
self.address = venue.address
self.description = venue.description
break
if self.location is None:
for venue in VENUES:
if venue.from_date < self.date.date() and (venue.until_date is None or venue.until_date > self.date.date()):
self.location = venue.name
self.address = venue.address
if self.description is None:
self.description = venue.description
break
if self.location is None:
# For some reason couldn't find it, use last venue in the list in the hope
# that "current" is more helpful than blank or exploding.
Expand Down
2 changes: 1 addition & 1 deletion templates/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@pubstandards" />
<meta property="og:title" content="{{event.name}}" />
<meta property="og:description" content="{{event.description|truncate(190)}}" />
{% if event.description %}<meta property="og:description" content="{{event.description|truncate(190)}}" />{% endif %}
<meta property="og:image" content="https://london.pubstandards.com/static/beer_mat.jpg" />
<meta property="og:url" content="https://london.pubstandards.com{{url_for('other_event', slug=event.slug)}}" />
{% endblock %}
Expand Down

0 comments on commit fd2065f

Please sign in to comment.