diff --git a/loko/assets/urls.py b/loko/assets/urls.py index 9278d70..c1b2d4d 100644 --- a/loko/assets/urls.py +++ b/loko/assets/urls.py @@ -161,6 +161,7 @@ urlpatterns = [ path('structures/locations//', structures.structures_locations_detail, name='structures_locations_detail'), path('structures/assets/', structures.structures_assets, name='structures_assets'), path('structures/assets/geojson/', structures.structures_assets_geojson, name='structures_assets_geojson'), + path('structures/assets/autocomplete/', structures.structures_assets_autocomplete, name='structures_autocomplete_assets'), path('structures/exceptional-transport/geojson/', structures.structures_exceptional_transport_geojson, name='structures_exceptional_transport_geojson'), path('structures/structures//edit-exceptional-transport/', structures.structures_edit_exceptional_transport, name='structures_edit_exceptional_transport'), path('structures///', structures.structures_assets_detail, name='structures_assets_detail'), diff --git a/loko/assets/views/structures.py b/loko/assets/views/structures.py index c1dabd8..2b88e5c 100644 --- a/loko/assets/views/structures.py +++ b/loko/assets/views/structures.py @@ -61,9 +61,10 @@ def structures_index(request): selected_locations_ids = draft_data.get('locations', []) + user_config, _ = UserConfig.objects.get_or_create(user=request.user) thematic_choices_qs = ( UserThematics.objects - .filter(user_config=request.user.config, can_view_assets=True) + .filter(user_config=user_config, can_view_assets=True) .select_related('thematic') .order_by(f'thematic__{"name_nl" if lang == "nl" else "name_fr"}') )