Skip to content

Commit

Permalink
fix: on TenderSiae survey_transaction answer, only update Tender if T…
Browse files Browse the repository at this point in the history
…rue. ref #1124
  • Loading branch information
raphodn committed Mar 11, 2024
1 parent 1e9539f commit 14c2e05
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lemarche/www/tenders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,14 @@ def get(self, request, *args, **kwargs):
self.object.survey_transactioned_answer = survey_transactioned_answer
self.object.survey_transactioned_answer_date = timezone.now()
self.object.save()
# update tender
if self.object.tender.siae_transactioned is None:
self.object.tender.siae_transactioned = survey_transactioned_answer
self.object.tender.siae_transactioned_source = (
tender_constants.TENDER_SIAE_TRANSACTIONED_SOURCE_SIAE
)
self.object.tender.save()
# update tender if True
if self.object.survey_transactioned_answer:
if self.object.tender.siae_transactioned is None:
self.object.tender.siae_transactioned = survey_transactioned_answer
self.object.tender.siae_transactioned_source = (
tender_constants.TENDER_SIAE_TRANSACTIONED_SOURCE_SIAE
)
self.object.tender.save()
else:
pass
# TODO or not? "answer" should always be passed
Expand Down

0 comments on commit 14c2e05

Please sign in to comment.