Skip to content

Commit

Permalink
Merge pull request #4019 from mikhailprivalov/fix_form_result
Browse files Browse the repository at this point in the history
Fix form result
  • Loading branch information
Wellheor1 authored Jun 29, 2024
2 parents c79885b + 353ccaa commit fe2ff0d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
24 changes: 16 additions & 8 deletions ftp_orders/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,22 @@ def pull_result(self, file: str):
if ref_str:
ref_str = ref_str.replace('"', "'")
ref_str = f'{{"Все": "{ref_str}"}}'
Result(
issledovaniye=iss,
fraction=fraction,
value=value,
units=units,
ref_f=ref_str,
ref_m=ref_str,
).save()
if Result.objects.filter(issledovaniye=iss, fraction=fraction).first():
update_result = Result.objects.filter(issledovaniye=iss, fraction=fraction).first()
update_result.value = value
update_result.units = units
update_result.ref_f = ref_str
update_result.ref_m = ref_str
update_result.save()
else:
Result(
issledovaniye=iss,
fraction=fraction,
value=value,
units=units,
ref_f=ref_str,
ref_m=ref_str,
).save()
else:
iss.lab_comment = ("",)
iss.time_confirmation = (None,)
Expand Down
4 changes: 4 additions & 0 deletions results/laboratory_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ def lab_form_1(fwb, interactive_text_field, pw, direction, styleSheet, directory
if iss.api_app:
laboratory_analyzer_data.append(iss.api_app.name)

fsli_data = []
if len(fractions) > 0:
if len(fractions) == 1:
tmp = [Paragraph('<font face="FreeSans" size="8">' + iss.research.title + "</font>", styleSheet["BodyText"])]
Expand Down Expand Up @@ -690,6 +691,9 @@ def lab_form_1(fwb, interactive_text_field, pw, direction, styleSheet, directory

result_is_norm = []
for f in fractions:
if f.fsli in fsli_data:
continue
fsli_data.append(f.fsli)
j += 1

tmp = []
Expand Down

0 comments on commit fe2ff0d

Please sign in to comment.