From 1a0c4e63f5e283a67ba7ae954702e0616ef023b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Mon, 4 Dec 2023 22:21:43 +0100 Subject: [PATCH] lots of small fixes and todo removals --- src/c3nav/api/urls.py | 1 - src/c3nav/control/forms.py | 3 +-- src/c3nav/control/views/access.py | 1 - src/c3nav/editor/api/endpoints.py | 2 -- src/c3nav/editor/api/schemas.py | 4 ++-- src/c3nav/mapdata/api/map.py | 2 +- 6 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/c3nav/api/urls.py b/src/c3nav/api/urls.py index bc91adc2..a106f25e 100644 --- a/src/c3nav/api/urls.py +++ b/src/c3nav/api/urls.py @@ -25,7 +25,6 @@ ninja_api.add_router("/mesh/", mesh_api_router) urlpatterns = [ - # todo: does this work? can it be better? path('v2/', ninja_api.urls), path('', RedirectView.as_view(pattern_name="api-v2:openapi-view")), ] diff --git a/src/c3nav/control/forms.py b/src/c3nav/control/forms.py index 8aad5628..41cdf162 100644 --- a/src/c3nav/control/forms.py +++ b/src/c3nav/control/forms.py @@ -159,11 +159,10 @@ class AccessPermissionForm(Form): unique_key=unique_key) def get_signed_data(self, key=None): - # todo: yep, we stil need to fix this try: api_secret = self.author.api_secrets.filter(scope_grant_permission=True).valid_only().get().api_secret except Secret.DoesNotExist: - raise ValueError('Author has no feasable api secret.') + raise ValueError('Author has no feasible api secret.') data = { 'id': self.data['access_restrictions'], 'time': int(time.time()), diff --git a/src/c3nav/control/views/access.py b/src/c3nav/control/views/access.py index 9c208203..216cf6f1 100644 --- a/src/c3nav/control/views/access.py +++ b/src/c3nav/control/views/access.py @@ -21,7 +21,6 @@ def grant_access(request): # todo: make class based view if form.is_valid(): token = form.get_token() token.save() - # todo: this still needs fixing if settings.DEBUG: signed_data = form.get_signed_data() print('/?'+urlencode({'access': signed_data})) diff --git a/src/c3nav/editor/api/endpoints.py b/src/c3nav/editor/api/endpoints.py index a02dddc3..e14f961c 100644 --- a/src/c3nav/editor/api/endpoints.py +++ b/src/c3nav/editor/api/endpoints.py @@ -70,7 +70,6 @@ def space_geometries(request, space_id: EditorID, update_cache_key: UpdateCacheK update_cache_key=update_cache_key, update_cache_key_match=kwargs["update_cache_key_match"] ) - # todo: test the heck out of this @editor_api_router.get('/geometries/level/{level_id}/', summary="level geometries", @@ -90,7 +89,6 @@ def level_geometries(request, level_id: EditorID, update_cache_key: UpdateCacheK update_cache_key=update_cache_key, update_cache_key_match=kwargs["update_cache_key_match"] ) - # todo: test the heck out of this # todo: need a way to pass the changeset if it's not a session API key diff --git a/src/c3nav/editor/api/schemas.py b/src/c3nav/editor/api/schemas.py index 26c8292b..b55e90ba 100644 --- a/src/c3nav/editor/api/schemas.py +++ b/src/c3nav/editor/api/schemas.py @@ -31,7 +31,7 @@ EditorGeometriesUpdateCacheKeyElem = Annotated[ Annotated[NonEmptyStr, APIField(title="the new cache key")], ], APIField( - title="new cache key", # todo better explanation + title="new cache key", description="the first element of the list, it informs you of the cache key to store these geometries under" ) ] @@ -41,7 +41,7 @@ EditorGeometriesCacheReferenceElem = Annotated[ Annotated[EditorID, APIField(title="geometry id")], # this could be an editor id, right? ], APIField( - title="reference to a cached geometry", # todo better explanation + title="reference to a cached geometry", description="replaces an element that has not changed from the cache key you supplied. get it from your cache." ) ] diff --git a/src/c3nav/mapdata/api/map.py b/src/c3nav/mapdata/api/map.py index 4c0d64c0..dbe81200 100644 --- a/src/c3nav/mapdata/api/map.py +++ b/src/c3nav/mapdata/api/map.py @@ -48,7 +48,7 @@ class LocationEndpointParameters(Schema): def can_access_geometry(request): - return True # todo: implementFd + return True # todo: implement class LocationListFilters(BySearchableFilter, RemoveGeometryFilter):