def _conferenceRegistration(self, request, reg=True): """Register or unregister user for selected conference.""" userProfile = profileUtils.getProfileForLoggedInUser() # get user Profile # check if conf exists given websafeConfKey # get conference; check that it exists conferenceKey = request.websafeConferenceKey conference = ndb.Key(urlsafe=conferenceKey).get() if not conference: raise endpoints.NotFoundException( 'No conference found with key: %s' % wsck) # register if reg: conferenceUtils.registerUserForConference(userProfile, conference) # unregister else: conferenceUtils.unregisterUserForConference(userProfile, conference)
def _copyConferenceToForm(self, conf, displayName): """Copy relevant fields from Conference to ConferenceForm.""" return conferenceUtils.copyConferenceToForm(conf, displayName)