Skip to content

Commit

Permalink
Fix migration issue on settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
twymer committed Dec 23, 2013
1 parent 8c3424e commit 03f1d18
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions corehq/apps/commtrack/models.py
Expand Up @@ -147,6 +147,20 @@ class CommtrackActionConfig(DocumentSchema):
_keyword = StringProperty() # sms code
caption = StringProperty() # display title

@classmethod
def wrap(cls, data):
if 'action_type' in data:
data['action'] = data['action_type']
del data['action_type']

if 'name' in data:
if data['name'] == 'lost':
data['subaction'] = 'loss'

del data['name']

return super(CommtrackActionConfig, cls).wrap(data)

def __repr__(self):
return '{action} ({subaction}): {caption} ({_keyword})'.format(**self._doc)

Expand Down

0 comments on commit 03f1d18

Please sign in to comment.