Token update fails when referenced table doesn't exist
Quick Information
Updating token through PATCH /api/database/tokens/{id}
fails when trashed or non-existing table id is referenced. The same behavior is likely to occur when a non-existing database is referenced. See the offending code: https://gitlab.com/bramw/baserow/-/blob/develop/backend/src/baserow/contrib/database/api/tokens/serializers.py#L107
- Baserow Version: Develop / 1.8
Steps to reproduce
- Create a token that is allowed to be used for
create
operation and it is associated with a particular table. - Delete that table.
- Update the token to allow
create
operation for a different table.
Actual result
An error occurs (KeyError).
Expected result
The table-token association is removed once the table doesn't exist. If a non-existing table or database is passed to REST API, a validation error is returned, properly propagated to the UI.
Priority/Severity
-
Medium (anything that negatively affects the user experience)
Edited by Petr Stribny