From 8fa93e813d7f4dbe1a219390fb3154c7ad232ba9 Mon Sep 17 00:00:00 2001
From: Fredrik Jonsson <frjo@xdeb.org>
Date: Wed, 29 Aug 2018 23:23:28 +0200
Subject: [PATCH] Add fake address for submissions that do not have one.

---
 .../apply/funds/management/commands/migrate_rr_applications.py | 1 -
 opentech/apply/funds/management/commands/migration_base.py     | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/opentech/apply/funds/management/commands/migrate_rr_applications.py b/opentech/apply/funds/management/commands/migrate_rr_applications.py
index 157822fce..d9cf561b2 100644
--- a/opentech/apply/funds/management/commands/migrate_rr_applications.py
+++ b/opentech/apply/funds/management/commands/migrate_rr_applications.py
@@ -15,7 +15,6 @@ class Command(MigrateCommand):
         "field_application_name": {
             "id": "full_name",
             "type": "value",
-            # If no Drupal value key is specified, we default to 'value'
             "key": "safe_value",
         },
         "field_application_mail": {
diff --git a/opentech/apply/funds/management/commands/migration_base.py b/opentech/apply/funds/management/commands/migration_base.py
index 4677175dd..e19e97e22 100644
--- a/opentech/apply/funds/management/commands/migration_base.py
+++ b/opentech/apply/funds/management/commands/migration_base.py
@@ -109,6 +109,9 @@ class MigrateCommand(BaseCommand):
             else:
                 form_data["email"] = f"user+{node['uid']}@exeample.com"
 
+        if "address" not in form_data:
+            form_data["address"] = json.dumps({"country": "GB", "thoroughfare": "This is not a real address!", "premise": "", "localityname": "London", "administrativearea": "", "postalcode": "123"})
+
         submission.form_data = form_data
 
         try:
-- 
GitLab