Skip to content

Commit

Permalink
Fix Marketplace guidebook export
Browse files Browse the repository at this point in the history
We now include only approved dealers in the Guidebook export and schedule changes page. Also, we no longer mark schedule items as synced when you export the schedule XLSX so you can review the full schedule without marking everything as synced.
  • Loading branch information
kitsuta committed Jan 6, 2025
1 parent 7e30727 commit af1a018
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions uber/site_sections/schedule_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,11 @@ def schedule_guidebook_xlsx(self, out, session, new_only=False):
))

rows = []
id_list = []
sync_time = str(datetime.now())
query = session.query(Event).order_by('start_time')
if new_only:
query = query.filter(Event.last_synced['guidebook'] == None)

for event in query.all():
id_list.append(event.id)
guidebook_fields = event.guidebook_data
rows.append([
guidebook_fields['name'],
Expand All @@ -95,7 +92,6 @@ def schedule_guidebook_xlsx(self, out, session, new_only=False):
'', '', '', '', ''
])

sync_guidebook_models.delay('schedule', sync_time, id_list)
out.writerows(header_row, rows)

@xlsx_file
Expand Down
4 changes: 2 additions & 2 deletions uber/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def parse_guidebook_model(cls, selected_model=''):

@classmethod
def get_guidebook_models(cls, session, selected_model=''):
from uber.models import GuestBio, MITSPicture, IndieGameImage
from uber.models import Group, GuestBio, MITSPicture, IndieGameImage

model_cls = cls.parse_guidebook_model(selected_model)
model_query = session.query(model_cls)
Expand All @@ -676,7 +676,7 @@ def get_guidebook_models(cls, session, selected_model=''):
model_query = model_query.filter_by(group_type=c.GUEST).outerjoin(model_cls.bio)
stale_filters.append(cls.cast_jsonb_to_datetime(model_cls.last_synced['guidebook']) < GuestBio.last_updated)
elif '_dealer' in selected_model:
model_query = model_query.filter_by(is_dealer=True)
model_query = model_query.filter(model_cls.status.in_([c.APPROVED])).filter_by(is_dealer=True)
elif 'IndieGame' in selected_model:
model_query = model_query.filter_by(has_been_accepted=True).outerjoin(model_cls.images)
stale_filters.append(cls.cast_jsonb_to_datetime(model_cls.last_synced['guidebook']) < IndieGameImage.last_updated)
Expand Down

0 comments on commit af1a018

Please sign in to comment.