Skip to content

Commit

Permalink
fix: editing a hidden event shouldn't fail
Browse files Browse the repository at this point in the history
  • Loading branch information
dodumosu committed Oct 25, 2024
1 parent 7cba91b commit ef60077
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apollo/frontend/views_admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import re
from datetime import datetime
from io import BytesIO
from urllib.parse import urlencode
Expand Down Expand Up @@ -209,12 +210,15 @@ def get_query(self):
def filter_hidden(self, query):
model_class = self.model
query_params = request.args.to_dict(flat=False)
show_hidden = bool(query_params.get(self.query_param_name))
if show_hidden:
show_hidden_direct = bool(query_params.get(self.query_param_name))
show_hidden_param = any(
re.search(rf'{self.query_param_name}=[^&]+', item)
for item in query_params.get("url", [])
)
if show_hidden_direct or show_hidden_param:
pass
else:
query = query.filter(model_class.is_hidden == False) # noqa

return query

def render(self, template, **kwargs):
Expand Down

0 comments on commit ef60077

Please sign in to comment.