From fe811f37bd03f52222ff273fb7620989155e7a45 Mon Sep 17 00:00:00 2001 From: Schylar Utley Date: Sat, 16 Jan 2021 00:06:04 -0600 Subject: [PATCH] replace loop with list comprehension --- startup_scripts/290_webhooks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/startup_scripts/290_webhooks.py b/startup_scripts/290_webhooks.py index 3b40fcf..315cf44 100644 --- a/startup_scripts/290_webhooks.py +++ b/startup_scripts/290_webhooks.py @@ -18,9 +18,7 @@ def get_content_type_id(content_type_str): for hook in webhooks: obj_types = hook.pop('object_types') - obj_type_ids = [] - for obj in obj_types: - obj_type_ids.append(get_content_type_id(obj)) + obj_type_ids = [ get_content_type_id(obj) for obj in obj_types ] if obj_type_ids is not None: webhook = Webhook(**hook) if not Webhook.objects.filter(name=webhook.name):