Skip to content

Conversation

@c-w
Copy link
Member

@c-w c-w commented Oct 11, 2019

As reported in #379, it's currently not possible to edit a label that has a shortcut key set. This is because in the LabelSerializer we're checking if any other label has the same prefix or suffix key as the serialized label:

https://github.com/chakki-works/doccano/blob/55c6cc27abfdd9d8ab8cfc4ef493116519f750c4/app/api/serializers.py#L43-L46

However, if we're editing a label and not changing its prefix or suffix key, the check will always retrieve the currently edited label as a conflict. The solution to this problem implemented in this pull request is to exclude the currently edited label from the check.

Resolves #379

@c-w c-w force-pushed the bugfix/edit-label-with-shortcut branch 2 times, most recently from 1a466a3 to f195929 Compare October 14, 2019 20:20
@c-w c-w force-pushed the bugfix/edit-label-with-shortcut branch from f195929 to 8222ea6 Compare October 19, 2019 05:00
@Hironsan Hironsan merged commit 34dfe21 into doccano:master Oct 29, 2019
@c-w c-w deleted the bugfix/edit-label-with-shortcut branch October 29, 2019 13:21
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

Successfully merging this pull request may close these issues.

Can't change label after assigning the shortcut key

2 participants