Commit dd3121ae82fd736e1d32719210128928ab609cdd

Authored by haribo
1 parent ad85da7c
Exists in master and in 1 other branch dev

Minor debugs on routine manager

src/pyros/settings.py
... ... @@ -20,7 +20,7 @@ MODULES_VERSIONS = {
20 20 "Majordome" : "0.3",
21 21 "Monitoring" : "0.1",
22 22 "Observation Manager" : "0.2",
23   - "Routine Manager" : "0.1",
  23 + "Routine Manager" : "0.2",
24 24 "Scheduler" : "0.1",
25 25 "User Manager" : "0.1",
26 26 }
... ...
src/pyrosapp/models.py
... ... @@ -158,7 +158,7 @@ class Filter(models.Model):
158 158  
159 159 class FilterWheel(models.Model):
160 160 device = models.OneToOneField(Device, on_delete=models.CASCADE)
161   - detector = models.OneToOneField(Detector, on_delete=models.CASCADE, blank=True, null=True)
  161 + detector = models.OneToOneField(Detector, on_delete=models.CASCADE, related_name="filter_wheel", blank=True, null=True)
162 162  
163 163 class Meta:
164 164 managed = True
... ...
src/routine_manager/forms.py
... ... @@ -97,13 +97,16 @@ class PlanForm(forms.ModelForm):
97 97  
98 98 def __init__(self, *args, readonly=False, **kwargs):
99 99 super(PlanForm, self).__init__(*args, **kwargs)
  100 + plan = kwargs["instance"]
  101 +
  102 + self.fields["filter"].queryset = plan.album.detector.filter_wheel.filters
  103 +
100 104 for field in self.fields.values():
101 105 if readonly == True:
102 106 field.widget.attrs['readonly'] = True
103 107 field.widget.attrs['class'] = 'form-control'
104 108 field.required = True
105 109  
106   - plan = kwargs["instance"]
107 110 if plan.duration:
108 111 self.fields["duration"].initial = plan.duration * 86400
109 112  
... ...
src/routine_manager/views.py
... ... @@ -405,6 +405,12 @@ def unsubmit_request(request, req_id):
405 405 """
406 406  
407 407 req = Request.objects.get(id=req_id)
  408 +
  409 +# TODO: Décommenter pour la production
  410 +# if req.sequences.filter(Q(status=Sequence.EXECUTED) | Q(status=Sequence.EXECUTING)).exists():
  411 +# message = "You can't unsubmit an request with executed sequences"
  412 +# return redirect(action_request, req_id=req_id, action="view", status=-1, message=message)
  413 +
408 414 req.submitted = False
409 415 req.save()
410 416 sequences = req.sequences.filter(Q(status=Sequence.TOBEPLANNED) | Q(status=Sequence.OBSERVABLE) |
... ...
src/simulation_images/65 0 → 100644
src/simulation_images/65_analyzed 0 → 100644
src/simulation_images/68 0 → 100644
src/simulation_images/68_analyzed 0 → 100644
src/simulation_images/69 0 → 100644
src/simulation_images/69_analyzed 0 → 100644
src/simulation_images/70 0 → 100644
src/simulation_images/70_analyzed 0 → 100644