From 483d5f9a2abb68b4d15a3b7b46663a4681be2a62 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 19 Mar 2017 19:24:37 +0000 Subject: [PATCH] Silenced an unnecessary error which could occur when looking for charter documents for groups (such as bofs) without them, by asking the API for a group description. - Legacy-Id: 13025 --- ietf/group/models.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ietf/group/models.py b/ietf/group/models.py index b77d7b08f..b3fdd46ba 100644 --- a/ietf/group/models.py +++ b/ietf/group/models.py @@ -2,6 +2,7 @@ import datetime import email.utils +import os import re from urlparse import urljoin @@ -179,10 +180,12 @@ class Group(GroupInfo): if self.description: desc = self.description elif self.charter: - text = self.charter.text() - # split into paragraphs and grab the first non-empty one - if text: - desc = [ p for p in re.split('\r?\n\s*\r?\n\s*', text) if p.strip() ][0] + path = self.charter.get_file_name() + if os.path.exists(path): + text = self.charter.text() + # split into paragraphs and grab the first non-empty one + if text: + desc = [ p for p in re.split('\r?\n\s*\r?\n\s*', text) if p.strip() ][0] return desc class GroupHistory(GroupInfo):