Skip to content

Gamification: Accepted proposals counter is incremented when an accepted proposal answer is edited #5797

@leio10

Description

@leio10

Describe the bug
When an admin user edits an accepted proposal answer, the system will increment the accepted proposals counter for the proposal authors, even when that proposal was already counted.

To Reproduce
Steps to reproduce the behavior:

  1. Choose an accepted proposal with a real user as author or coauthor.
  2. Go to that user badges page, and check the "accepted proposals" badge.
  3. Go to the proposal admin page.
  4. Click on the answer button
  5. Refresh the user badges page, and check that the "accepted proposals" badge has increased the number of the accepted proposals.

Expected behavior
Editing an answer should not increment the counter of accepted proposals for the users. Also, what should happen if an admin changes a proposal from the state accepted to another state? Should it decrement the counter?

Screenshots
The proposal author badge before editing the proposal answer:
imagen

The proposal answer is edited, keeping the accepted state.
imagen

The proposal author badge after editing the proposal answer:
imagen

Stacktrace
If applicable, add the error stacktrace to help explain your problem.

Extra data (please complete the following information):

  • Device: Desktop
  • Device OS: [e.g. iOS8.1, Windows 10]
  • Browser: [e.g. Chrome, Firefox, Safari]
  • Decidim Version: develop, but it seems to affect all versions released since the introduction of this badge (New badges #4033)
  • Decidim installation: development app

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions