From 8b5996b7fe523c06f411c312d9c8583c48445717 Mon Sep 17 00:00:00 2001 From: luto Date: Fri, 13 Oct 2017 20:28:36 +0200 Subject: [PATCH] [import] extract all meaningfull code out of Command.handle --- byro_shackspace/management/commands/import_shackbureau.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/byro_shackspace/management/commands/import_shackbureau.py b/byro_shackspace/management/commands/import_shackbureau.py index ccebe74..956e843 100644 --- a/byro_shackspace/management/commands/import_shackbureau.py +++ b/byro_shackspace/management/commands/import_shackbureau.py @@ -146,6 +146,11 @@ def import_member(member_data): _import_transactions(member_data, member) +def import_members(data): + for member in data: + import_member(member) + + class Command(BaseCommand): help = 'Imports a frab xml export' @@ -158,5 +163,4 @@ class Command(BaseCommand): with open(path) as export: data = json.load(export) - for member in data: - import_member(member) + import_members(data)