From b5ddb82dd0e94ebdc2efb9555a3860b0179bfe61 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 29 Apr 2020 12:07:34 -0400 Subject: [PATCH] Fix validation errors on new list --- hubsrht/blueprints/mailing_lists.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hubsrht/blueprints/mailing_lists.py b/hubsrht/blueprints/mailing_lists.py index 4a4e9d6..cd643f6 100644 --- a/hubsrht/blueprints/mailing_lists.py +++ b/hubsrht/blueprints/mailing_lists.py @@ -91,12 +91,13 @@ Mailing list for end-user discussion and questions related to the try: mailing_list = lists.get_list(owner, list_name) except: - mailing_list = lists.create_list(owner, Validation({ + valid = Validation({ "name": list_name, "description": descs[list_name], - })) - if not mailing_list: - raise Exception(json.dumps(valid.response)) + }) + mailing_list = lists.create_list(owner, valid)) + if not mailing_list: + raise Exception(json.dumps(valid.response)) ml = MailingList() ml.remote_id = mailing_list["id"]