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

same Add-on can be added multiple times to the same component via API #6500

Closed
Findus23 opened this issue Sep 1, 2021 · 3 comments
Closed
Assignees
Labels
bug Something is broken.
Milestone

Comments

@Findus23
Copy link
Contributor

Findus23 commented Sep 1, 2021

Describe the issue

It's also not that severe, but can cause a bit of confusion when using the API to edit components:

When adding an add-on to a component via the API there doesn't seem to be any check if this component already has an add-on of this type allowing one to end up with multiple Customize JSON output add-ons in one component overwriting each other.
I don't think there is any reason to add an add-on twice (as the UI doesn't allow this), so maybe the API should also disallow this.

To Reproduce the issue

Steps to reproduce the behavior:

  1. Use https://docs.weblate.org/en/latest/api.html#post--api-components-(string-project)-(string-component)-addons- to add an add-on to the component
  2. repeat
  3. see that the same add-on type (but two different instances) are now part of the component
    Expected behavior

The second API request should fail

Server configuration and status

on hosted.weblate.org

@nijel nijel self-assigned this Sep 1, 2021
@nijel nijel added the bug Something is broken. label Sep 1, 2021
@nijel nijel added this to the 4.8.1 milestone Sep 1, 2021
@nijel nijel closed this as completed in b9646f2 Sep 1, 2021
@github-actions
Copy link

github-actions bot commented Sep 1, 2021

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@nijel
Copy link
Member

nijel commented Sep 1, 2021

Oops, I mixed up the two issues.

@nijel nijel reopened this Sep 1, 2021
@nijel nijel closed this as completed in b45da11 Sep 1, 2021
@github-actions
Copy link

github-actions bot commented Sep 1, 2021

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

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

No branches or pull requests

2 participants