Skip to content

Commit 4d6f0e4

Browse files
Minor fix
1 parent 000e3ee commit 4d6f0e4

11 files changed

Lines changed: 1076 additions & 968 deletions

File tree

frontend/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,15 +1939,15 @@ def ensemble_renamed(sender, instance, **kwargs):
19391939
for o in instance.calculationorder_set.all():
19401940
o._source = o._serialize_source(o._get_source())
19411941
o._label = o._get_label()
1942-
o.save()
1942+
o.save(update_fields=["_source", "_label"])
19431943
for o in instance.result_of.all():
19441944
o._label = o._get_label()
1945-
o.save()
1945+
o.save(update_fields=["_label"])
19461946
for s in instance.structure_set.all():
19471947
for o in s.calculationorder_set.all():
19481948
o._label = o._get_label()
19491949
o._source = o._serialize_source(o._get_source())
1950-
o.save()
1950+
o.save(update_fields=["_label", "_source"])
19511951

19521952

19531953
@receiver(post_save, sender=Molecule)
@@ -1956,7 +1956,7 @@ def molecule_renamed(sender, instance, **kwargs):
19561956
for e in instance.ensemble_set.all():
19571957
for o in e.calculationorder_set.all():
19581958
o._molecule_name = o._get_molecule_name()
1959-
o.save()
1959+
o.save(update_fields=["_molecule_name"])
19601960

19611961

19621962
@receiver(post_save, sender=Project)

frontend/test_views.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,33 @@ def create_processing_order(self):
18991899

19001900
return order, molecule
19011901

1902+
def test_link_order_redirects_to_child_result_when_order_links_are_missing(self):
1903+
order, molecule = self.create_processing_order()
1904+
result_ensemble = Ensemble.objects.create(
1905+
name="Result Ensemble", parent_molecule=molecule
1906+
)
1907+
calc = Calculation.objects.create(
1908+
order=order,
1909+
structure=order.structure,
1910+
step=order.step,
1911+
parameters=order.parameters,
1912+
result_ensemble=result_ensemble,
1913+
date_submitted=timezone.now(),
1914+
status=2,
1915+
)
1916+
1917+
order.start_calc = calc
1918+
order.structure = None
1919+
order.ensemble = None
1920+
order.result_ensemble = None
1921+
order.save(
1922+
update_fields=["start_calc", "structure", "ensemble", "result_ensemble"]
1923+
)
1924+
1925+
response = self.client.get(f"/link_order/{order.id}")
1926+
1927+
self.assertRedirects(response, f"/ensemble/{result_ensemble.id}")
1928+
19021929
def create_direct_ensemble_order(self):
19031930
project = Project.objects.create(name="Direct Project", author=self.user)
19041931
molecule = Molecule.objects.create(name="Direct Molecule", project=project)

frontend/tests/cache/frontend.test_selenium.LaunchParametersTests.test_sketcher_mol/calc.out

Lines changed: 304 additions & 289 deletions
Large diffs are not rendered by default.
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
18
22
Molecule from ChemDoodle Web Components
3-
C 1.35789 -0.13680 0.00638
4-
C 0.52029 -1.25975 -0.02700
5-
C -0.86832 -1.06941 -0.01522
6-
C -1.40808 0.21740 0.00367
7-
C -0.56615 1.32775 0.01883
8-
C 0.81603 1.15106 0.02487
9-
C 1.09997 -2.64984 -0.08086
10-
C 1.31309 -3.25554 1.29764
11-
H 2.43829 -0.25641 0.00628
12-
H -1.53862 -1.92657 -0.03161
13-
H -2.48658 0.35330 0.00076
14-
H -0.98733 2.32959 0.02598
15-
H 1.47291 2.01658 0.03717
16-
H 2.05244 -2.62935 -0.62476
17-
H 0.43537 -3.29829 -0.66735
18-
H 2.02044 -2.66428 1.88818
19-
H 1.71696 -4.26960 1.20289
20-
H 0.37388 -3.31780 1.85694
3+
C 1.35660 -0.13880 -0.00240
4+
C 0.51836 -1.26116 -0.03815
5+
C -0.87005 -1.07166 -0.01997
6+
C -1.40905 0.21589 0.00973
7+
C -0.56620 1.32493 0.02944
8+
C 0.81597 1.14811 0.02784
9+
C 1.09950 -2.65108 -0.08806
10+
C 1.30897 -3.24226 1.29737
11+
H 2.43693 -0.26058 -0.00387
12+
H -1.54058 -1.92757 -0.03673
13+
H -2.48718 0.35281 0.01359
14+
H -0.98646 2.32753 0.04554
15+
H 1.47406 2.01288 0.04747
16+
H 2.05359 -2.63095 -0.62845
17+
H 0.43698 -3.30259 -0.67067
18+
H 2.01026 -2.64058 1.88496
19+
H 1.71789 -4.25487 1.21579
20+
H 0.36719 -3.30145 1.85286

frontend/tests/cache/frontend.test_selenium.LaunchParametersTests.test_sketcher_mol/xtbopt.log

Lines changed: 172 additions & 152 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
18
2-
energy: -22.214838677931 gnorm: 0.000258512443 xtb: 6.6.0 (8843059)
3-
C 1.35302498203595 -0.15661086011283 -0.03522698415591
4-
C 0.52482134786001 -1.27046506751128 -0.08187729987373
5-
C -0.85072798179778 -1.08045046976726 -0.04924905178992
6-
C -1.38710219734969 0.19262877220735 0.02434868983352
7-
C -0.55231325465301 1.29608429062231 0.06827851554907
8-
C 0.82011273996672 1.11811053159577 0.03803856863458
9-
C 1.10447728054036 -2.65617190520395 -0.11635124895808
10-
C 1.28463943584741 -3.19642176910353 1.30357229655003
11-
H 2.42565218393392 -0.28995041951741 -0.05942744944423
12-
H -1.50698872619079 -1.93890942551195 -0.08513060572859
13-
H -2.45932379439449 0.32459380617495 0.04565636860954
14-
H -0.96971970760946 2.29074664292364 0.12334148777100
15-
H 1.47731120764148 1.97521169172866 0.07030957778985
16-
H 2.07281910548933 -2.64037481367448 -0.62085829146600
17-
H 0.44057957522546 -3.32147523877176 -0.67251098738423
18-
H 1.95413258159633 -2.55328191275771 1.87063177888069
19-
H 1.70361869016234 -4.19998315294129 1.27998864199398
20-
H 0.32746653169594 -3.23124070037920 1.81925599318840
2+
energy: -22.214839005085 gnorm: 0.000095275559 xtb: 6.6.0 (8843059)
3+
C 1.35075816275564 -0.15480244316057 -0.03398412851594
4+
C 0.52234330827812 -1.26851440247447 -0.08083261528374
5+
C -0.85315434890042 -1.07827009341011 -0.04759704536688
6+
C -1.38923536474755 0.19487860872893 0.02627206752831
7+
C -0.55426189205950 1.29817756265481 0.06997557611744
8+
C 0.81810135839144 1.11996081371077 0.03962075576962
9+
C 1.10191705884911 -2.65419980961564 -0.11676757212444
10+
C 1.28606029461428 -3.19432921908066 1.30276505689256
11+
H 2.42337028686357 -0.28832668482217 -0.05881530187516
12+
H -1.50960601699436 -1.93660375339928 -0.08335688719866
13+
H -2.46145818035092 0.32700388237842 0.04864665016587
14+
H -0.97150373897627 2.29294586525555 0.12606755384727
15+
H 1.47551415025365 1.97691080023486 0.07223866542861
16+
H 2.06890626207210 -2.63841261733351 -0.62385170849470
17+
H 0.43657516179749 -3.31964110665807 -0.67100469029184
18+
H 1.95650576822888 -2.55071543757312 1.86808727669294
19+
H 1.70572567961377 -4.19754407355996 1.27801930628563
20+
H 0.33022205031094 -3.22991789187578 1.82080704042311

0 commit comments

Comments
 (0)