diff --git a/crowdsourcer/management/commands/import_national_data.py b/crowdsourcer/management/commands/import_national_data.py index 6c659d9..0a71df6 100644 --- a/crowdsourcer/management/commands/import_national_data.py +++ b/crowdsourcer/management/commands/import_national_data.py @@ -190,7 +190,15 @@ def import_answers(self, user, rt, df, q, details): for _, row in df.iterrows(): if details.get("skip_check", None) is not None: skip_check = details["skip_check"] - if row[skip_check["col"]] == skip_check["val"]: + if ( + skip_check.get("unless_match") + and row[skip_check["col"]] != skip_check["val"] + ): + continue + elif ( + not skip_check.get("unless_match") + and row[skip_check["col"]] == skip_check["val"] + ): continue gss_col = details.get("gss_col", "Local Authority Code")