Skip to content

Commit fe811f3

Browse files
MajesticFalconcimnine
authored andcommitted
replace loop with list comprehension
1 parent 8321449 commit fe811f3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

startup_scripts/290_webhooks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ def get_content_type_id(content_type_str):
1818

1919
for hook in webhooks:
2020
obj_types = hook.pop('object_types')
21-
obj_type_ids = []
22-
for obj in obj_types:
23-
obj_type_ids.append(get_content_type_id(obj))
21+
obj_type_ids = [ get_content_type_id(obj) for obj in obj_types ]
2422
if obj_type_ids is not None:
2523
webhook = Webhook(**hook)
2624
if not Webhook.objects.filter(name=webhook.name):

0 commit comments

Comments
 (0)