Skip to content

Commit 3da2ecf

Browse files
committed
add debug option so can output more verbose info
1 parent 7726fd9 commit 3da2ecf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

crowdsourcer/management/commands/import_volunteers.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,16 @@ def add_arguments(self, parser):
138138
help="run everything and then undo changes. Helpful to check if assigment weighting is good",
139139
)
140140

141+
parser.add_argument(
142+
"--debug",
143+
action="store_true",
144+
help="spit out extra debug information",
145+
)
146+
141147
def init(self, file, options):
142148
self.column_names = list(COLUMN_NAMES)
143149
self.usecols = list(USECOLS)
150+
self.debug = False
144151

145152
if file is None:
146153
file = self.volunteer_file
@@ -153,6 +160,9 @@ def init(self, file, options):
153160
self.column_names.append("council_restrictions")
154161
self.usecols.append("Nations/London")
155162

163+
if options["debug"]:
164+
self.debug = True
165+
156166
def get_df(self, filename):
157167
df = pd.read_csv(
158168
filename,
@@ -200,7 +210,6 @@ def get_assignment_count(self, user_type, row, assignment_count_in_data):
200210
return num_councils
201211

202212
def add_users_and_assignments(self, df, response_type, session, rt, options):
203-
204213
bad_councils = []
205214
for index, row in df.iterrows():
206215
if pd.isna(row["email"]):

0 commit comments

Comments
 (0)