fix(site-map): allow tab-separated survey files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DEls 2026-10-14 08:52:19 +02:00
parent 0b04613ae1
commit f06d545e02
2 changed files with 9 additions and 1 deletions

View file

@ -53,7 +53,7 @@ def definitions(sites_id, models_id):
"fields": [
site, model,
{"name": "file", "type": "file", "required": True, "maxSelect": 1, "maxSize": 1048576,
"mimeTypes": ["text/csv", "text/plain", "application/vnd.ms-excel"], "protected": True},
"mimeTypes": ["text/csv", "text/plain", "text/tab-separated-values", "application/vnd.ms-excel"], "protected": True},
{"name": "matched", "type": "number", "required": False},
{"name": "unmatched", "type": "json", "required": False, "maxSize": 200000},
{"name": "user", "type": "text", "required": False, "max": 50},

View file

@ -39,3 +39,11 @@ class SiteMapMigrationTests(unittest.TestCase):
if __name__ == "__main__":
unittest.main()
class SurveyFileTypes(unittest.TestCase):
def test_survey_file_accepts_tab_separated(self):
defs = {d["name"]: d for d in migration.definitions("sites0", "models0")}
f = next(x for x in defs["site_survey_imports"]["fields"] if x["name"] == "file")
self.assertIn("text/tab-separated-values", f["mimeTypes"])