Skip to content

Commit 481e306

Browse files
committed
Only create alias content if user is authenticated
1 parent ec9c2c5 commit 481e306

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

djangocms_alias/templatetags/djangocms_alias_tags.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def _get_alias(self, request, static_code, extra_bits):
117117

118118
alias = Alias.objects.create(category=default_category, **alias_creation_kwargs)
119119

120-
if not alias.get_content(language=self.language, show_draft_content=self.get_draft_content):
120+
if (
121+
not alias.get_content(language=self.language, show_draft_content=self.get_draft_content)
122+
and request.user.is_authenticated
123+
):
121124
alias_content = AliasContent.objects.with_user(request.user).create(
122125
alias=alias,
123126
name=static_code,

0 commit comments

Comments
 (0)