Browse Source

Require configuration to be related to a subscription

Baptiste Jonglez 10 years ago
parent
commit
38eedab124

+ 19 - 0
coin/configuration/migrations/0003_auto_20140924_2052.py

@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('configuration', '0002_auto_20140919_2158'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='configuration',
+            name='offersubscription',
+            field=models.OneToOneField(related_name=b'configuration', verbose_name=b'abonnement', to='offers.OfferSubscription'),
+        ),
+    ]

+ 2 - 3
coin/configuration/models.py

@@ -20,10 +20,9 @@ url_namespace variable to specify the url namespace used by this model.
 
 class Configuration(PolymorphicModel):
 
-    offersubscription = models.OneToOneField(OfferSubscription, blank=True, 
-                                             null=True,
+    offersubscription = models.OneToOneField(OfferSubscription,
                                              related_name='configuration',
-                                             verbose_name='Abonnement')
+                                             verbose_name='abonnement')
 
     @staticmethod
     def get_configurations_choices_list():