From 1020063da5ac3bbb9e6360e9796a5eb5d6d06fa9 Mon Sep 17 00:00:00 2001 From: Lei Yang Date: Sun, 14 Jun 2015 14:40:57 +0800 Subject: [PATCH] handle exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pagure don’t accept empty content --- server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.py b/server.py index a58d6ea..ab2ac8a 100644 --- a/server.py +++ b/server.py @@ -33,6 +33,8 @@ def do_POST(self): print("======================================") pagure_title = '[' + str(info['id']) + ']: ' + info['title'] + ' by ' + info['creator'] # TODO: now containing all the metadata in the title, should use a more elegant solution + if info['content'] == '': + info['content'] = "*Not specified*" pagure_payload = {'title': pagure_title, 'issue_content': info['content'], 'status': "Open"} pagure_URL = "https://pagure.io/api/0/" + pagureRepo + "/new_issue"