Skip to content
Snippets Groups Projects
Commit d460dbb8 authored by Alice Heaton's avatar Alice Heaton :speech_balloon:
Browse files

Merge branch 'enable_profiles' into develop

parents 3ec1be5d 80724ddc
Branches
No related tags found
No related merge requests found
......@@ -26,39 +26,7 @@ class Importer(object):
error_msg = _('Misconfigured service. Source "%s" does not exist') % label
raise SheetImportException(error_msg)
# TODO: Revert to using database
# return sheet_profile.profile
return {
"label": "geopoll",
"name": "Geopoll",
"format": "excel",
"type": "message",
"columns": [
{
"name": "Province",
"type": "ignore",
"field": "ignore"
},
{
"name": "CreatedDate",
"type": "date",
"field": "timestamp",
"date_format": "%m/%d/%y"
},
{
"name": "AgeGroup",
"type": "ignore",
"field": "ignore"
},
{
"name": "QuestIO",
"type": "text",
"field": "body"
}
],
"skip_header": 1
}
return sheet_profile.profile
def get_columns_map(self, col_list):
'''This function assumes that column names are unique for spreadsheet.
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
GEOPOLL_CONFIG = {
"label": "geopoll",
"name": "Geopoll",
"format": "excel",
"type": "message",
"columns": [
{
"name": "Province",
"type": "ignore",
"field": "ignore"
},
{
"name": "CreatedDate",
"type": "date",
"field": "timestamp",
"date_format": "%m/%d/%y"
},
{
"name": "AgeGroup",
"type": "ignore",
"field": "ignore"
},
{
"name": "QuestIO",
"type": "text",
"field": "body"
}
],
"skip_header": 1
}
def update_geopoll_config(apps, schema_editor):
Profile = apps.get_model('chn_spreadsheet', 'SheetProfile')
Profile.objects.update(label='geopoll', profile=GEOPOLL_CONFIG)
class Migration(migrations.Migration):
dependencies = [
('chn_spreadsheet', '0002_add_geopoll_config'),
]
operations = [
migrations.RunPython(update_geopoll_config)
]
......@@ -38,7 +38,6 @@ def importer():
@pytest.mark.django_db
@pytest.mark.xfail
def test_get_profile_returns_profile(importer):
label = "unknownpoll"
profile = {'name': 'Empty profile'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment