diff --git a/fet2020/posts/views.py b/fet2020/posts/views.py index 79f4d362..0c46473e 100644 --- a/fet2020/posts/views.py +++ b/fet2020/posts/views.py @@ -142,25 +142,17 @@ def show(request, id=None): filename_agenda = None filename_protocol = None - if p.has_agenda: # and p.agenda_key: - try: - ep_agenda_link = get_pad_link(p.agenda_key) - filename_agenda = p.slug + "-agenda.pdf" - except Exception as e: - logger.error( - "Can't get the agenda link from '%s'. Error: %s", p.agenda_key, e - ) - ep_agenda_link = "#" + if p.has_agenda: + ep_agenda_link = get_pad_link(p.agenda_key) - if p.has_protocol: # and p.protocol_key: - try: - ep_protocol_link = get_pad_link(p.protocol_key) + if ep_agenda_link != "#": + filename_agenda = p.slug + "-agenda.pdf" + + if p.has_protocol: + ep_protocol_link = get_pad_link(p.protocol_key) + + if ep_protocol_link != "#": filename_protocol = p.slug + "-protokoll.pdf" - except Exception as e: - logger.error( - "Can't get the protocol link from '%s. Error: %s", p.protocol_key, e - ) - ep_protocol_link = "#" related_posts = p.tags.similar_objects()