Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete tileset using uuid through REST api #86

Open
mildewey opened this issue Nov 30, 2018 · 2 comments
Open

Cannot delete tileset using uuid through REST api #86

mildewey opened this issue Nov 30, 2018 · 2 comments

Comments

@mildewey
Copy link
Contributor

Given a tileset with uuid sim_02_sorted.ballele

The following call to the rest interface returns an error and does not delete the tileset:
DELETE .../api/v1/tilesets/sim_02_sorted.ballele

<h1>Not Found</h1>
<p>The requested URL /api/v1/tilesets/sim_02_sorted.ballele/ was not found on this server.</p>
@alexpreynolds
Copy link
Contributor

alexpreynolds commented Dec 3, 2018

The tileset API may disallow use of the slash and dot characters (cf. https://www.django-rest-framework.org/api-guide/routers/). This behavior could perhaps be changed by adding (untested):

lookup_value_regex = '[^.]+'

or similar to the TilesetsViewSet class (cf. https://github.com/higlass/higlass-server/blob/develop/tilesets/views.py#L686).

A question might be whether this change in parsing would be a good thing to do, and I don't know the answer to that. Django API calls can use a file extension to specify MIME type (which uses a dot character), so playing with how the API parses URL slugs may not be desirable. Or there may be no side effects, as far as current and future API calls to tilesets are concerned. This is probably a better question for @pkerpedjiev. A typical UUID that follows specification will not contain period or forward slash characters and the API does not appear to expect to parse a slug and ignore those characters.

As workarounds until more discussion can be happen on that, you might replace dots with underscores or other delimiters in your custom UUIDs when ingesting tileset files, or perhaps use the management script to handle assets with these non-spec UUIDs, e.g.:

$ python manage.py delete_tileset --uuid="sim_02_sorted.ballele"

This modifies the underlying Django database through a different process, which does not involve parsing a REST request.

@alexpreynolds
Copy link
Contributor

Discussion in this PR may be related: #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants