Applied template based on creation_template field

remotes/origin/enhancement/email-actions
Jesús Espino 2014-08-05 17:07:02 +02:00
parent 9331fe057f
commit defb061175
1 changed files with 3 additions and 2 deletions

View File

@ -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()