Applied template based on creation_template field
parent
9331fe057f
commit
defb061175
|
@ -745,8 +745,9 @@ def project_post_save(sender, instance, created, **kwargs):
|
||||||
if not created:
|
if not created:
|
||||||
return
|
return
|
||||||
|
|
||||||
template_slug = getattr(instance, "template", None) or settings.DEFAULT_PROJECT_TEMPLATE
|
template = getattr(instance, "creation_template", None)
|
||||||
template = ProjectTemplate.objects.get(slug=template_slug)
|
if template is None:
|
||||||
|
template = ProjectTemplate.objects.get(slug=settings.DEFAULT_PROJECT_TEMPLATE)
|
||||||
template.apply_to_project(instance)
|
template.apply_to_project(instance)
|
||||||
|
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
Loading…
Reference in New Issue