Skip to content

Commit 7435069

Browse files
committed
fix: editing a hidden event shouldn't fail
1 parent 9281642 commit 7435069

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apollo/frontend/views_admin.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
import re
23
from datetime import datetime
34
from io import BytesIO
45
from urllib.parse import urlencode
@@ -209,12 +210,15 @@ def get_query(self):
209210
def filter_hidden(self, query):
210211
model_class = self.model
211212
query_params = request.args.to_dict(flat=False)
212-
show_hidden = bool(query_params.get(self.query_param_name))
213-
if show_hidden:
213+
show_hidden_direct = bool(query_params.get(self.query_param_name))
214+
show_hidden_param = any(
215+
re.search(rf'{self.query_param_name}=[^&]+', item)
216+
for item in query_params.get("url", [])
217+
)
218+
if show_hidden_direct or show_hidden_param:
214219
pass
215220
else:
216221
query = query.filter(model_class.is_hidden == False) # noqa
217-
218222
return query
219223

220224
def render(self, template, **kwargs):

0 commit comments

Comments
 (0)