Skip to content

Commit

Permalink
Merge pull request #198 from NIAEFEUP/fix/unable-to-accept-direct-exc…
Browse files Browse the repository at this point in the history
…hange-from-marketplace

fix: unable to accept direct exchanges from marketplace
  • Loading branch information
tomaspalma authored Feb 9, 2025
2 parents b0d870f + f5447b4 commit 1530a4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion django/university/routes/exchange/DirectExchangeView.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ def put(self, request, id):
StudentController.populate_user_course_unit_data(int(participant.participant_nmec), erase_previous=True)

if exchange.marketplace_exchange:
exchange.marketplace_exchange.delete()
marketplace_exchange = exchange.marketplace_exchange
exchange.marketplace_exchange = None
exchange.save()
marketplace_exchange.delete()

ExchangeValidationController().cancel_conflicting_exchanges(int(exchange.id))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def post(self, request, token):
StudentController.populate_user_course_unit_data(int(participant.participant_nmec), erase_previous=True)

if direct_exchange.marketplace_exchange:
direct_exchange.marketplace_exchange.delete()
marketplace_exchange = direct_exchange.marketplace_exchange
direct_exchange.marketplace_exchange = None
direct_exchange.save()
marketplace_exchange.delete()

ExchangeValidationController().cancel_conflicting_exchanges(int(exchange_info["exchange_id"]))

Expand Down

0 comments on commit 1530a4d

Please sign in to comment.