Changeset 97539e in indico
- Timestamp:
- 01/28/11 16:11:35 (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, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- fced0f
- Parents:
- 2e8d57
- git-author:
- Adrian Moennich <jerome.ernst.monnich@…> (01/28/11 15:32:23)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (01/28/11 16:11:35)
- File:
-
- 1 edited
-
indico/MaKaC/registration.py (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/registration.py
r2e8d57 r97539e 126 126 form.setActivated(self.isActivated()) 127 127 form.setMandatoryAccount(self.isMandatoryAccount()) 128 form.setAllSessions()129 128 form.notification=self.getNotification().clone() 130 129 form.personalData = self.getPersonalData().clone() … … 138 137 if rpf is not None : 139 138 form.reasonParticipationForm = rpf.clone() 139 form.setAllSessions() 140 140 ses = self.getSessionsForm() 141 141 if ses is not None : … … 769 769 booking.append( _(""" 770 770 \tQuantity\t\tItem\t\tunit.price\t\tCost""")) 771 #All billable general fields 771 772 for gsf in registrant.getMiscellaneousGroupList(): 772 773 miscGroup=registrant.getMiscellaneousGroupById(gsf.getId()) … … 790 791 value=":%s"%value 791 792 if(quantity>0): 792 booking.append("""%i\t\t%s : %s%s\t\t%s\t\t%s %s"""%(quantity,miscGroup.getTitle(),caption,value,price,price*quantity,currency) ) 793 booking.append("""%i\t\t%s : %s%s\t\t%s\t\t%s %s"""%(quantity,miscGroup.getTitle(),caption,value,price,price*quantity,currency) ) 794 #All billable standard fields (accommodation, sessions, social events) 793 795 for bf in registrant.getBilledForms(): 794 796 for item in bf.getBilledItems(): … … 4064 4066 self.setReasonParticipation(data.get("reason","")) 4065 4067 4068 4066 4069 if self.getRegistrationForm().getSessionsForm().isEnabled(): 4067 sessions =data.get("sessions",[])4070 sessions = data.get("sessions", []) 4068 4071 if not isinstance(sessions, list): 4069 4072 sessions = [ sessions ] … … 4076 4079 newSessions += [session for session in sessions if not session.isBillable()] 4077 4080 self.setSessions(newSessions) 4081 else: 4082 self.setSessions([]) 4078 4083 4079 4084 if self.getRegistrationForm().getAccommodationForm().isEnabled(): … … 4091 4096 if ad > dd: 4092 4097 raise FormValuesError( _("Arrival date has to be earlier than departure date")) 4093 if self.getRegistrationForm().getAccommodationForm().getAccommodationTypesList() !=[] and data.get("accommodationType",None) is None:4094 raise FormValuesError( _("It is mandatory to choose an accommodation in order to register"))4095 4098 # Allow changing of the dates only if the current accomodation is not billable or the user hasn't paid yet 4096 4099 currentAccoType = self._accommodation.getAccommodationType() … … 4108 4111 ((currentAccoType is None or not currentAccoType.isBillable()) and \ 4109 4112 (accoType is None or not accoType.isBillable())): 4113 if self.getRegistrationForm().getAccommodationForm().getAccommodationTypesList() !=[] and data.get("accommodationType",None) is None: 4114 raise FormValuesError( _("It is mandatory to choose an accommodation in order to register")) 4110 4115 self._accommodation.setAccommodationType(accoType) 4116 else: # AccommodationForm disabled 4117 self._accommodation.setAccommodationType(None) 4111 4118 4112 4119 if self.getRegistrationForm().getSocialEventForm().isEnabled(): … … 4120 4127 newSE = SocialEvent(seItem, int(data.get("places-%s"%seItem.getId(), "1"))) 4121 4128 self.addSocialEvent(newSE) 4129 else: 4130 for seItem in self.getSocialEvents()[:]: 4131 self.removeSocialEventById(seItem.getId()) 4122 4132 #if not self.getPayed(): 4123 4133 # self._miscellaneous = {} … … 4439 4449 4440 4450 def getBilledForms(self): 4451 """ 4452 4453 """ 4441 4454 forms = [] 4442 4455 if self._accommodation: … … 4572 4585 if at is not None: 4573 4586 at.increaseNoPlaces() 4587 self._price = at.getPrice() 4588 self._billable = at.isBillable() 4589 self._currency = at.getCurrency() 4590 else: 4591 self._price = 0 4592 self._billable = False 4593 self._currency = "" 4574 4594 self._accommodationType = at 4575 self._price = at.getPrice()4576 self._billable = at.isBillable()4577 self._currency = at.getCurrency()4578 4595 4579 4596 class SocialEvent(Persistent):
Note: See TracChangeset
for help on using the changeset viewer.
