lots of small fixes and todo removals

This commit is contained in:
Laura Klünder 2023-12-04 22:21:43 +01:00
parent 82aa079af0
commit 1a0c4e63f5
6 changed files with 4 additions and 9 deletions

View file

@ -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")),
]

View file

@ -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()),

View file

@ -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}))

View file

@ -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

View file

@ -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."
)
]

View file

@ -48,7 +48,7 @@ class LocationEndpointParameters(Schema):
def can_access_geometry(request):
return True # todo: implementFd
return True # todo: implement
class LocationListFilters(BySearchableFilter, RemoveGeometryFilter):