diff --git a/wcs_olap/feeder.py b/wcs_olap/feeder.py index ac6b4d2..66f29e1 100644 --- a/wcs_olap/feeder.py +++ b/wcs_olap/feeder.py @@ -246,6 +246,7 @@ class WcsOlapFeeder(object): [2, 'mail', u'courrier'], [3, 'phone', u'téléphone'], [4, 'counter', u'guichet'], + [5, 'backoffice', u'backoffice'], ] channel_to_id = dict((c[1], c[0]) for c in channels) id_to_channel = dict((c[0], c[1]) for c in channels) @@ -484,11 +485,14 @@ class WcsFormdefFeeder(object): continue status = data.formdef.schema.workflow.statuses_map[data.workflow.status.id] + channel = data.submission.channel.lower() + if channel == 'web' and data.submission.backoffice: + channel = 'backoffice' row = { 'formdef_id': self.formdef_sql_id, 'receipt_time': data.receipt_time, 'hour_id': data.receipt_time.hour, - 'channel_id': self.channel_to_id[data.submission.channel.lower()], + 'channel_id': self.channel_to_id[channel], 'backoffice': data.submission.backoffice, # FIXME "En cours"/2 is never used 'generic_status_id': 3 if status.endpoint else 1,