Handle missing attribute exception

This commit is contained in:
Christian Cueni 2019-08-15 14:48:18 +02:00
parent a81e211789
commit 3ae39cefce
1 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,10 @@ from rooms.models import ModuleRoomSlug
@hooks.register('after_edit_page')
@hooks.register('after_create_page')
def do_after_page_edit(request, page):
blocks = get_room_blocks(page)
try:
blocks = get_room_blocks(page)
except AttributeError:
return
for block in blocks:
if isinstance(block, tuple):
title = block[1]['title']