mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 08:51:09 -05:00
code optimization for python 3.9+
This commit is contained in:
@@ -93,9 +93,8 @@ class SearchView(TemplateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
query = self.request.GET.get('q', '').strip()
|
||||
|
||||
if query:
|
||||
if query := self.request.GET.get('q', '').strip():
|
||||
# Search parks
|
||||
context['parks'] = Park.objects.filter(
|
||||
Q(name__icontains=query) |
|
||||
|
||||
Reference in New Issue
Block a user