diff --git a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py index 9b01a3da93f1916f9119ea7781fe847fe3644db6..fedf0592a12c0a923ea386b93e7d2b3eb1e2daa5 100644 --- a/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py +++ b/SAS/TMSS/src/tmss/tmssapp/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.6 on 2020-07-14 21:21 +# Generated by Django 3.0.6 on 2020-07-14 21:50 from django.conf import settings import django.contrib.postgres.fields @@ -1019,7 +1019,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='project', name='cycles', - field=models.ManyToManyField(help_text='Cycles to which this project belongs (NULLable).', related_name='projects', to='tmssapp.Cycle'), + field=models.ManyToManyField(blank=True, help_text='Cycles to which this project belongs (NULLable).', related_name='projects', to='tmssapp.Cycle'), ), migrations.AddField( model_name='project', diff --git a/SAS/TMSS/src/tmss/tmssapp/models/specification.py b/SAS/TMSS/src/tmss/tmssapp/models/specification.py index d5a83d8971087fc970af8bd925dd5403840fc642..34b5b981e3fadfd750539d8e314af31a0978cc38 100644 --- a/SAS/TMSS/src/tmss/tmssapp/models/specification.py +++ b/SAS/TMSS/src/tmss/tmssapp/models/specification.py @@ -276,7 +276,7 @@ class Cycle(NamedCommonPK): class Project(NamedCommonPK): - cycles = ManyToManyField('Cycle', related_name='projects', help_text='Cycles to which this project belongs (NULLable).') + cycles = ManyToManyField('Cycle', blank=True, related_name='projects', help_text='Cycles to which this project belongs (NULLable).') priority_rank = FloatField(null=False, help_text='Priority of this project w.r.t. other projects. Projects can interrupt observations of lower-priority projects.') # todo: add if needed: validators=[MinValueValidator(0.0), MaxValueValidator(1.0)] trigger_priority = IntegerField(default=1000, help_text='Priority of this project w.r.t. triggers.') # todo: verify meaning and add to help_text: "Triggers with higher priority than this threshold can interrupt observations of projects." can_trigger = BooleanField(default=False, help_text='True if this project is allowed to supply observation requests on the fly, possibly interrupting currently running observations (responsive telescope).') diff --git a/SAS/TMSS/test/tmss_test_data_rest.py b/SAS/TMSS/test/tmss_test_data_rest.py index ada401713f68345bfd3bbf9374f62c6ecc7e2a84..5e83ad35086a6226a135c5facfb0b2a2145d3fa9 100644 --- a/SAS/TMSS/test/tmss_test_data_rest.py +++ b/SAS/TMSS/test/tmss_test_data_rest.py @@ -141,7 +141,8 @@ class TMSSRESTTestDataCreator(): "priority_rank": 1.0, "trigger_priority": 1000, "can_trigger": False, - "private_data": True} + "private_data": True, + "cycles": []} def ResourceUnit(self): return {