Skip to content

Commit

Permalink
Remove references to QueryOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Jan 10, 2024
1 parent 28fb78b commit ac31f0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
5 changes: 1 addition & 4 deletions conreq/_core/app_store/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from reactpy import component, hooks
from reactpy_django.components import django_css
from reactpy_django.hooks import use_query
from reactpy_django.types import QueryOptions

from conreq._core.app_store.components.nav import app_store_nav
from conreq._core.app_store.components.spotlight import spotlight
Expand All @@ -15,9 +14,7 @@
def app_store(): # sourcery skip
state, set_state = hooks.use_state(AppStoreState())
state.set_state = lambda obj: set_state(copy(obj))
nav_category_query = use_query(
QueryOptions(thread_sensitive=False), get_nav_categories
)
nav_category_query = use_query(get_nav_categories)

# Don't render if there's an error loading categories
if nav_category_query.error:
Expand Down
9 changes: 2 additions & 7 deletions conreq/_core/app_store/components/spotlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
from reactpy.types import VdomChild
from reactpy_django.components import django_css
from reactpy_django.hooks import use_query
from reactpy_django.types import QueryOptions

from conreq._core.app_store.components.card import card
from conreq._core.app_store.models import AppPackage, SpotlightCategory


@component
def spotlight():
spotlight_category_query = use_query(
QueryOptions(thread_sensitive=False), get_spotlight_categories
)
spotlight_category_query = use_query(get_spotlight_categories)

if spotlight_category_query.loading or spotlight_category_query.error:
return
Expand Down Expand Up @@ -45,9 +42,7 @@ def spotlight_section(
apps: Manager[AppPackage],
):
# FIXME: This shouldn't be needed, but `OrderedManyToManyField` doesn't work with `django_query_postprocessor`
spotlight_apps_query = use_query(
QueryOptions(thread_sensitive=False), get_spotlight_apps, apps
)
spotlight_apps_query = use_query(get_spotlight_apps, apps)
opacity, set_opacity = hooks.use_state(0)
card_list: list[VdomChild] = (
[card(app, key=app.uuid) for app in spotlight_apps_query.data] # type: ignore
Expand Down

0 comments on commit ac31f0b

Please sign in to comment.