Changeset 2e8d57 in indico for indico/MaKaC/webinterface/rh/registrantsModif.py
- Timestamp:
- 01/28/11 15:57:45 (2 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 4c7d4152dff271ba5df5a8606605969cab454080
- Children:
- 97539e
- Parents:
- c50671
- git-author:
- Adrian Moennich <jerome.ernst.monnich@…> (01/28/11 15:20:03)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (01/28/11 15:57:45)
- File:
-
- 1 edited
-
indico/MaKaC/webinterface/rh/registrantsModif.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/webinterface/rh/registrantsModif.py
r9cd2c8 r2e8d57 570 570 def _process( self ): 571 571 if not self._cancel: 572 self._registrant.setSessions(self._sessions) 572 if not self._registrant.getPayed(): 573 sessions = self._sessions 574 else: 575 # First keep all sessions which are billable (they are not submitted anymore) 576 sessions = [session for session in self._registrant.getSessionList() if session.isBillable()] 577 # Then take all chosen sessions which are not billable 578 sessions += [session for session in self._sessions if not session.isBillable()] 579 self._registrant.setSessions(sessions) 573 580 self._redirect(urlHandlers.UHRegistrantModification.getURL(self._registrant)) 574 581 … … 606 613 def _process( self ): 607 614 if not self._cancel: 608 self._registrant.getAccommodation().setArrivalDate(self._arrivalDate) 609 self._registrant.getAccommodation().setDepartureDate(self._departureDate) 615 # Allow changing of the dates only if the current accomodation is not billable or the user hasn't paid yet 616 currentAccoType = self._registrant.getAccommodation().getAccommodationType() 617 if not self._registrant.getPayed() or currentAccoType is None or not currentAccoType.isBillable(): 618 self._registrant.getAccommodation().setArrivalDate(self._arrivalDate) 619 self._registrant.getAccommodation().setDepartureDate(self._departureDate) 610 620 if self._regForm.getAccommodationForm().getAccommodationTypesList() !=[]: 611 self._registrant.getAccommodation().setAccommodationType(self._accoType) 621 # Only change the accommodation type if: 622 # - the registrant hasn't paid yet OR 623 # - neither the current nor the new accommodation is billable 624 if not self._registrant.getPayed() or \ 625 ((currentAccoType is None or not currentAccoType.isBillable()) and \ 626 (self._accoType is None or not self._accoType.isBillable())): 627 self._registrant.getAccommodation().setAccommodationType(self._accoType) 612 628 self._redirect(urlHandlers.UHRegistrantModification.getURL(self._registrant)) 613 629 … … 642 658 if not self._cancel: 643 659 for seItem in self._registrant.getSocialEvents()[:]: 644 self._registrant.removeSocialEventById(seItem.getId()) 660 # Remove all items which can be added back (i.e. if paid only non-billable ones) 661 if not (self._registrant.getPayed() and seItem.isBillable()): 662 self._registrant.removeSocialEventById(seItem.getId()) 645 663 646 664 l = [] 647 665 for seItem in self._socialEvents: 648 newSE = SocialEvent(seItem, int(self._places[seItem.getId()])) 649 self._registrant.addSocialEvent(newSE) 666 # Only add item if the registrant hasn't paid yet or the item is not billable 667 if not self._registrant.getPayed() or not seItem.isBillable(): 668 newSE = SocialEvent(seItem, int(self._places[seItem.getId()])) 669 self._registrant.addSocialEvent(newSE) 650 670 self._redirect(urlHandlers.UHRegistrantModification.getURL(self._registrant)) 651 671
Note: See TracChangeset
for help on using the changeset viewer.
