Skip to content

Commit

Permalink
fix добавления емкостей
Browse files Browse the repository at this point in the history
  • Loading branch information
Wellheor1 committed Dec 16, 2024
1 parent 8cf2713 commit e711bb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/construct/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def get_lab_ref_books(request):
materials = LaboratoryMaterial.get_materials()
subgroups = SubGroupPadrazdeleniye.get_subgroup_podrazdeleniye(request_data["departmentId"])
variants = ResultVariants.get_all()
tubes = Tubes.get_all()
tubes = Tubes.get_all(True)
relations_tubes = ReleationsFT.get_all_relation()
result = {"units": units, "materials": materials, "subGroups": subgroups, "variants": variants, "tubes": tubes, "relations": relations_tubes}
return JsonResponse({"result": result})
Expand Down
4 changes: 2 additions & 2 deletions researches/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def get_short_title(self):
return pr

@staticmethod
def get_all():
def get_all(pk_in_title=False):
result = [
{
"id": tube.pk,
"label": f"{tube.title} - tube.pk",
"label": tube.title if not pk_in_title else f"{tube.title} ({tube.pk})",
"color": tube.color,
}
for tube in Tubes.objects.all()
Expand Down

0 comments on commit e711bb6

Please sign in to comment.