WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit c6c7c55

Browse files
committed
Added safety chck on content_category attribute
1 parent 5ebf594 commit c6c7c55

File tree

1 file changed

+4
-1
lines changed
  • src/collective/iconifiedcategory/content

1 file changed

+4
-1
lines changed

src/collective/iconifiedcategory/content/events.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ def content_updated(obj, event):
126126

127127

128128
def categorized_content_updated(obj, event, is_created=False):
129-
category = utils.get_category_object(obj, obj.content_category)
129+
if hasattr(obj, 'content_category'):
130+
category = utils.get_category_object(obj, obj.content_category)
131+
else:
132+
return
130133

131134
if category.show_preview in (1, 2):
132135
queueJob(obj)

0 commit comments

Comments
 (0)