From f16a923c1610dcb8ef05dbe9ee9c8b9eefd5f350 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Mon, 16 Dec 2019 16:22:22 -0900 Subject: [PATCH] Fix missing argument in add_new_channel --- geeksbot_web/channels/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/geeksbot_web/channels/models.py b/geeksbot_web/channels/models.py index 75bfabc..150899c 100644 --- a/geeksbot_web/channels/models.py +++ b/geeksbot_web/channels/models.py @@ -38,10 +38,11 @@ class Channel(models.Model): @classmethod def add_new_channel(cls, data): id = data.get('id') - if id and cls.get_channel_by_id(id): + guild_id = data.get('guild') + + if id and cls.get_channel_by_id(guild_id, id): return create_error_response('Channel Already Exists', status=status.HTTP_409_CONFLICT) - guild_id = data.get('guild') if not (id and guild_id): return create_error_response('ID and Guild are required', status=status.HTTP_400_BAD_REQUEST)