You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
With the same exact codebase, I am able to use the make_clone() method as well as making a duplicate of an instance from within the specific instance's "Change" view in the admin panel, but I cannot make a clone from the admin view where i select instances to duplicate, select duplicate from the dropdown, and then press "Go"
To Reproduce
Define the following models:
classTas(CloneMixin, models.Model):
"""The top level object of the TAS which only holds top-level necessary information"""productName=models.CharField(
max_length=MAX_CHAR_LENGTH, verbose_name="Product Name", unique=True)
metadata=models.OneToOneField(
"TasMetadata", on_delete=models.DO_NOTHING, blank=True, null=True, related_name='tas')
slug=AutoSlugField(populate_from='productName', always_update=True, unique=True, editable=False)
_clone_m2o_or_o2m_fields= ['diagrams']
_clone_excluded_fields= ['slug']
def__str__(self):
returnself.productNameclassMeta:
verbose_name_plural="TASes"classTasMetadata(CloneMixin, models.Model):
"""Separate class to hold information which should be easily editable and versionable about the TAS model"""nickname=models.CharField(
max_length=MAX_CHAR_LENGTH, help_text="Familiar codename")
predecessor=models.ForeignKey(
Tas, on_delete=DO_NOTHING, blank=True, null=True, related_name='children', help_text="Optional: The \"parent\" TAS")
npiPhase=models.ForeignKey(
NpiPhase, blank=True, null=True, on_delete=SET_NULL, default=None, verbose_name="NPI Phase")
_clone_m2m_fields= ['npiPhase']
def__str__(self):
returnf"{self.tas} (a.k.a {self.nickname})"classMeta:
verbose_name='TAS Metadata'verbose_name_plural="TAS Metadata"
Describe the bug
With the same exact codebase, I am able to use the
make_clone()
method as well as making a duplicate of an instance from within the specific instance's "Change" view in the admin panel, but I cannot make a clone from the admin view where i select instances to duplicate, select duplicate from the dropdown, and then press "Go"To Reproduce
Expected behavior
The duplication should work from bulk view if it works from the single instance editor
Screenshots
N/A
Desktop (please complete the following information):
Additional context
This is the error that I get from the bulk view. Let me know if there's anything else I can provide for this.
Again, this works just fine when I do
Tas.objects.first().make_clone()
or when I run it from the instance editor.The text was updated successfully, but these errors were encountered: