Skip to content

Updating sponsor results in duplicate sponsor #2500

Closed

Description

@carvingpumpkins

Description of the issue 📄

I created a new sponsor and then made 2 separate updates to the details - that is, I hit "Save changes" after each update. This has resulted in 3 of the same sponsor being created. However, it's worth noting that, while searching for the sponsor from /admin/sponsors returns 3 results, only the sponsor with the ID 1541 actually shows a sponsor page when clicked on. The other 2 results (1539 & 1540) return an HTTP 500 response. So it would seem that only the sponsor created from the last update is valid (assuming the IDs are incremental).

Screenshots 📷

Image Image

Steps to fix 🛠

To do 📋

  • Claim this issue (comment below, or assign yourself if you are part of the codebar org)
  • Fork and clone the repository
  • Update the relevant files. Follow the steps to fix section in this issue.
  • Commit your changes as one commit. Use the title of this issue as your commit message
  • Submit a pull request
  • Mention this issue in the PR description by including it's number
  • Have your pull request reviewed & merged by a codebar team member

Activity

  1. mikej commented on Apr 13, 2026

    @mikej
    Contributor

    I've found the exceptions in Rollbar for attempts to view 1539 & 1540.

    Looks like this is because these sponsor records don't have a number of students or coach spots and the logic for displaying coach spots does:

    def coach_spots
      number_of_coaches || (seats / 2.0).round
    end

    resulting in undefined method '/' for nil when trying to fallback to seats / 2.0

    However, I haven't been able to recreate editing an existing sponsor leading to a duplicate being created. I've messaged @carvingpumpkins on Slack to ask if this is still happening for them.

  2. self-assigned this
    on Aug 6, 2026
  3. added a commit that references this issue on Sep 10, 2026
    1b91cd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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