From 3f7eb9c302328666892b7749953a8a149aa5942e Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 6 Jan 2016 13:24:20 +0100 Subject: [PATCH 2/5] agent/common: store new role field "details" (#9503) --- .../common/management/commands/hobo_notify.py | 3 +++ .../common/migrations/0002_auto_20160105_1702.py | 26 ++++++++++++++++++++++ hobo/agent/common/models.py | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 hobo/agent/common/migrations/0002_auto_20160105_1702.py diff --git a/hobo/agent/common/management/commands/hobo_notify.py b/hobo/agent/common/management/commands/hobo_notify.py index ff237f9..247e550 100644 --- a/hobo/agent/common/management/commands/hobo_notify.py +++ b/hobo/agent/common/management/commands/hobo_notify.py @@ -136,6 +136,9 @@ class Command(BaseCommand): if role.description != o['description']: role.description = o['description'] save = True + if role.details != o.get('details', u''): + role.details = o.get('details', u'') + save = True if save: role.save() if full and action == 'provision': diff --git a/hobo/agent/common/migrations/0002_auto_20160105_1702.py b/hobo/agent/common/migrations/0002_auto_20160105_1702.py new file mode 100644 index 0000000..71d2f03 --- /dev/null +++ b/hobo/agent/common/migrations/0002_auto_20160105_1702.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='role', + name='details', + field=models.TextField(default=''), + preserve_default=True, + ), + migrations.AlterField( + model_name='role', + name='description', + field=models.TextField(default=''), + preserve_default=True, + ), + ] diff --git a/hobo/agent/common/models.py b/hobo/agent/common/models.py index 19d0e90..6c3463f 100644 --- a/hobo/agent/common/models.py +++ b/hobo/agent/common/models.py @@ -4,4 +4,5 @@ from django.contrib.auth.models import Group class Role(Group): uuid = models.CharField(max_length=32) - description = models.TextField() + description = models.TextField(default=u'') + details = models.TextField(default=u'') -- 2.1.4