Skip to content

Commit

Permalink
Fix HTMX destination forms not allowing same label across different m…
Browse files Browse the repository at this point in the history
…edia
  • Loading branch information
stveit authored Dec 10, 2024
1 parent 6f30c88 commit 103abb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/1075.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug that made it so the HTMX destinations forms did not allow DestinationConfigs with different medias to have the same label.
2 changes: 1 addition & 1 deletion src/argus/htmx/destination/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _validate_serializer(self):
self.cleaned_data["settings"] = settings

if label := self.cleaned_data.get("label"):
destination_filter = DestinationConfig.objects.filter(label=label)
destination_filter = DestinationConfig.objects.filter(label=label, media=media)
if self.instance:
destination_filter = destination_filter.exclude(pk=self.instance.pk)
if destination_filter.exists():
Expand Down

0 comments on commit 103abb6

Please sign in to comment.