Fixes #21202: Avoid clearing scope on clone (#21265)

This commit is contained in:
Martin Hauser 2026-01-26 23:14:36 +01:00 committed by GitHub
parent e859807d1d
commit 1a2175127e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ class ScopedForm(forms.Form):
except ObjectDoesNotExist:
pass
if self.instance and scope_type_id != self.instance.scope_type_id:
if self.instance and self.instance.pk and scope_type_id != self.instance.scope_type_id:
self.initial['scope'] = None
else: