Skip to content

Commit

Permalink
Fix error on export when getting filename (django-cms#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfehr authored Feb 28, 2024
1 parent 7a1a005 commit eebaa38
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions djangocms_transfer/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,18 @@ def get_filename(self):
return "{}.json".format(
page.get_slug(language=language)
)

if placeholder:
elif placeholder and placeholder.page is not None:
return "{}_{}.json".format(
placeholder.page.get_slug(language=language),
slugify(placeholder.slot)
)

return "{}_{}.json".format(
plugin.page.get_slug(language=language),
slugify(plugin.get_short_description())
)
elif plugin is not None and plugin.page is not None:
return "{}_{}.json".format(
plugin.page.get_slug(language=language),
slugify(plugin.get_short_description())
)
else:
return 'plugins.json'

def run_export(self):
data = self.cleaned_data
Expand Down

0 comments on commit eebaa38

Please sign in to comment.