Skip to content

Commit

Permalink
Better selection of cards for homepage (fixed in prod long ago but ne…
Browse files Browse the repository at this point in the history
…ver pushed)
  • Loading branch information
db0company committed Sep 3, 2018
1 parent 1d6b304 commit 04e23d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bang/management/commands/generate_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def generate_settings():
two_days_ago = now - datetime.timedelta(days=2)
in_twelve_days = now + datetime.timedelta(days=12) # = event length 7d + 5d margin
events_with_cards = []
for version in models.Account.VERSIONS.values():
for version_name, version in models.Account.VERSIONS.items():
for event in (list(
models.Event.objects.filter(**{
version['prefix'] + 'end_date__gte': two_days_ago,
Expand All @@ -59,8 +59,8 @@ def generate_settings():
version['prefix'] + 'end_date__gte': now,
version['prefix'] + 'end_date__lte': in_twelve_days,
}))):
if version in ['JP', 'EN']:
events_with_cards += event
if version_name in ['JP', 'EN']:
events_with_cards.append(event)
image = getattr(event, u'{}image_url'.format(version['prefix']))
if not image:
continue
Expand Down

0 comments on commit 04e23d7

Please sign in to comment.