def update_account_subscription(self, uid): """ """ site = self.getSite() name = getUserFullName(site, uid) email = getUserEmail(site, uid) organization = getUserOrganization(site, uid) phone = getUserPhoneNumber(site, uid) account_subscription = AccountSubscription(uid, name, email, organization, phone) self._account_subscriptions.update({uid: account_subscription})
def update_account_subscription(self, uid): """ """ site = self.getSite() name = getUserFullName(site, uid) email = getUserEmail(site, uid) organization = getUserOrganization(site, uid) phone = getUserPhoneNumber(site, uid) account_subscription = AccountSubscription(uid, name, email, organization, phone) self._account_subscriptions.update({uid: account_subscription})
def getAttendeeInfo(self, uid): """ """ subscriptions = self.getSubscriptions() if subscriptions._is_signup(uid): user = subscriptions.getSignup(uid) name = user.name email = user.email organization = user.organization phone = user.phone else: site = self.getSite() name = getUserFullName(site, uid) email = getUserEmail(site, uid) organization = getUserOrganization(site, uid) phone = getUserPhoneNumber(site, uid) if not organization: organization = self.get_survey_answer(uid, 'w_organization') if not organization: organization = self.get_survey_answer(uid, 'w_organisation') if not phone: phone = self.get_survey_answer(uid, 'w_telephone') if not phone: phone = self.get_survey_answer(uid, 'w_phone') attendee = self._get_attendees()[uid] role = attendee['role'] country = attendee['country'] reimbursed = attendee['reimbursed'] saved_by = attendee['saved_by'] justification = attendee['justification'] ret = { 'uid': uid, 'name': name, 'email': email, 'organization': organization, 'phone': phone, 'role': role, 'country': country, 'reimbursed': reimbursed, 'saved_by': saved_by, 'justification': justification } for k, v in ret.items(): if not isinstance(v, basestring): ret[k] = u'' return ret
def _add_account_subscription(self, uid, accept=False): """ """ # If the subscription already exists or the user is alread signed up # skip the whole thing if self._is_account_subscription(uid): return key = uid.replace('signup:', '') if self._is_signup(key): return site = self.getSite() meeting = self.getMeeting() name = getUserFullName(site, uid) # If for any reason we still don't have a name, at least use UID if not name: name = uid email = getUserEmail(site, uid) organization = getUserOrganization(site, uid) if not organization: organization = self.get_survey_answer(uid, 'w_organization') if not organization: organization = self.get_survey_answer(uid, 'w_organisation') phone = getUserPhoneNumber(site, uid) if not phone: phone = self.get_survey_answer(uid, 'w_telephone') if not phone: phone = self.get_survey_answer(uid, 'w_phone') account_subscription = AccountSubscription(uid, name, email, organization, phone) self._account_subscriptions.insert(uid, account_subscription) if meeting.auto_register or accept: self._accept_account_subscription(uid) email_sender = self.getMeeting().getEmailSender() email_sender.send_account_subscription_email(account_subscription)
def _add_account_subscription(self, uid, accept=False): """ """ # If the subscription already exists or the user is alread signed up # skip the whole thing if self._is_account_subscription(uid): return key = uid.replace('signup:', '') if self._is_signup(key): return site = self.getSite() meeting = self.getMeeting() name = getUserFullName(site, uid) # If for any reason we still don't have a name, at least use UID if not name: name = uid email = getUserEmail(site, uid) organization = getUserOrganization(site, uid) if not organization: organization = self.get_survey_answer(uid, 'w_organization') if not organization: organization = self.get_survey_answer(uid, 'w_organisation') phone = getUserPhoneNumber(site, uid) if not phone: phone = self.get_survey_answer(uid, 'w_telephone') if not phone: phone = self.get_survey_answer(uid, 'w_phone') account_subscription = AccountSubscription(uid, name, email, organization, phone) self._account_subscriptions.insert(uid, account_subscription) if meeting.auto_register or accept: self._accept_account_subscription(uid) email_sender = self.getMeeting().getEmailSender() email_sender.send_account_subscription_email(account_subscription)
def getAttendeeInfo(self, uid): """ """ subscriptions = self.getSubscriptions() if subscriptions._is_signup(uid): user = subscriptions.getSignup(uid) name = user.name email = user.email organization = user.organization phone = user.phone else: site = self.getSite() name = getUserFullName(site, uid) email = getUserEmail(site, uid) organization = getUserOrganization(site, uid) phone = getUserPhoneNumber(site, uid) if not organization: organization = self.get_survey_answer(uid, 'w_organization') if not organization: organization = self.get_survey_answer(uid, 'w_organisation') if not phone: phone = self.get_survey_answer(uid, 'w_telephone') if not phone: phone = self.get_survey_answer(uid, 'w_phone') attendee = self._get_attendees()[uid] role = attendee['role'] country = attendee['country'] reimbursed = attendee['reimbursed'] saved_by = attendee['saved_by'].encode('utf-8') justification = attendee['justification'] ret = {'uid': uid, 'name': name, 'email': email, 'organization': organization, 'phone': phone, 'role': role, 'country': country, 'reimbursed': reimbursed, 'saved_by': saved_by, 'justification': justification} for k, v in ret.items(): if not isinstance(v, basestring): ret[k] = u'' return ret