possible that a renewal might occur without parent
@@ -168,7 +168,7 @@ class Application(models.Model):
def save(self, *args, **kwargs):
super(Application, self).save(*args, **kwargs)
- def renew(self):
+ def renew(self, parent=True):
"""
Create a reviewable clone of this application: that is, a PENDING
application dated today with the same user-submitted data (but with
@@ -185,18 +185,17 @@ class Application(models.Model):
"specific_title",
"comments",
"agreement_with_terms_of_use",
- "account_email",
],
)
- # Status and parent are explicitly different on the child than
- # on the parent application. For editor, partner, and stream, we
+ # Status, stream and parent are explicitly different on the child than
+ # on the parent application. For editor and partner, we
# need to pull those directly - model_to_dict will give us the pks
# of the referenced objects, but we need the actual objects.
data.update(
{
"status": self.PENDING,
- "parent": self,
+ "parent": self if parent else None,
"editor": self.editor,
"partner": self.partner,
"specific_stream": self.specific_stream,
