Skip to content

Add guard clause to prevent duplicate tab creation in license admin form#474

Closed
Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Kaushik-Kumar-CEG:fix-ui-tabs-469-final
Closed

Add guard clause to prevent duplicate tab creation in license admin form#474
Kaushik-Kumar-CEG wants to merge 1 commit intoaboutcode-org:mainfrom
Kaushik-Kumar-CEG:fix-ui-tabs-469-final

Conversation

@Kaushik-Kumar-CEG
Copy link

@Kaushik-Kumar-CEG Kaushik-Kumar-CEG commented Feb 14, 2026

Fixes #469

Issue

License admin form tabs ("License Data" / "Assigned Tag Values") were duplicating multiple times, breaking the UI.

Solution

Added if ($('#license_form > ul').length === 0) guard clause to prevent tab creation code from running multiple times. The tab initialization in $(document).ready()) can execute repeatedly due to Django admin AJAX interactions, causing duplicates.

Changes

  • license_library/templates/admin/license_library/license/change_form.html (lines 159-175): Wrapped tab creation in guard clause

Testing

Could not reproduce the bug locally (maybe an intermittent issue).

@DennisClark - Since you originally reported this bug, could you please test this fix in your environment (Starship/nexB) to verify it resolves the duplicate tabs issue? Your testing would be greatly appreciated!

Signed-off-by: Kaushik <kaushikrjpm10@gmail.com>
@DennisClark
Copy link
Member

DennisClark commented Feb 16, 2026

@Kaushik-Kumar-CEG and @tdruez the fix improves the situation: the "License Data | Assigned Tag Values" box does not repeat endlessly, but is shown only once; however, it should not show up at all. Also, the main menu bar is getting duplicated as well. Same results in Firefox and Chrome. So, there is some progress, but more to do.

Add license 2026-02-16 at 11 12 28

@tdruez
Copy link
Contributor

tdruez commented Feb 17, 2026

#469 (comment)

@tdruez tdruez closed this Feb 17, 2026
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.

BUG: UI rendering issue with Admin add/change license form

3 participants