-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: limit front page event display logic #5588
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/eventyay/open-event-frontend/5k1g2p7ar |
This needs to be done on server side in upcoming events route |
Codecov Report
@@ Coverage Diff @@
## development #5588 +/- ##
===============================================
+ Coverage 23.75% 23.88% +0.12%
===============================================
Files 498 498
Lines 5257 5262 +5
Branches 44 44
===============================================
+ Hits 1249 1257 +8
+ Misses 4002 3999 -3
Partials 6 6
Continue to review full report at Codecov.
|
class UpcomingEventList(EventList):
def query(self, view_kwargs):
current_time = datetime.now(pytz.utc)
query_ = (
self.session.query(Event)
.filter(
Event.starts_at > current_time,
Event.ends_at > current_time,
Event.state == 'published',
Event.privacy == 'public',
or_(
Event.is_promoted,
and_(
Event.original_image_url != None,
Event.logo_url != None,
Event.event_type_id != None,
Event.event_topic_id != None,
Event.event_sub_topic_id != None,
),
),
)
.order_by(Event.starts_at)
)
return query_ I have used Event.tickets, I want to use |
Event.query.filter(Event.tickets.any(and_(Ticket.deleted_at == None, Ticket.price > 0))) |
Fixes #5110
Checklist
development
branch.