Ejemplo n.º 1
0
	def post(self):
		user = users.get_current_user()
		profileId = self.request.get('profileId')
		userProfile = UserProfile.getFromEmail(profileId)
		if userProfile is None or canEditThisProfile == False:
			self.abort(404)
		user_profile_json = {}
		for field in UserProfile.getJsonFields():
			user_profile_json[field] = self.request.get(field)
		userProfile.profile = json.dumps(user_profile_json)
		userProfile.put()
		self.redirect('/profile?user_email=%s' % profileId)
Ejemplo n.º 2
0
 def post(self):
     user = users.get_current_user()
     profileId = self.request.get('profileId')
     userProfile = UserProfile.getFromEmail(profileId)
     if userProfile is None or canEditThisProfile == False:
         self.abort(404)
     user_profile_json = {}
     for field in UserProfile.getJsonFields():
         user_profile_json[field] = self.request.get(field)
     userProfile.profile = json.dumps(user_profile_json)
     userProfile.put()
     self.redirect('/profile?user_email=%s' % profileId)
Ejemplo n.º 3
0
	def get(self):
		if self.request.get('user_email'):
			userProfile = UserProfile.getFromEmail(self.request.get('user_email'))
			if userProfile is None:
				self.abort(404)
		else:
			userProfile = getMyProfile()
		(template_data, template) = get_template('templates/profile.html')
		userProfileData = {}
		profile_data = json.loads(userProfile.profile) if userProfile.profile else {}
		for field in UserProfile.getJsonFields():
			userProfileData[field] = profile_data.setdefault(field, '')
		template_data['user'] = userProfile
		template_data['user_profile'] = userProfileData
		template_data['profileId'] = userProfile.email
		template_data['readonly'] = not(canEditThisProfile(userProfile))
		self.response.out.write(template.render(template_data))
Ejemplo n.º 4
0
 def get(self):
     if self.request.get('user_email'):
         userProfile = UserProfile.getFromEmail(
             self.request.get('user_email'))
         if userProfile is None:
             self.abort(404)
     else:
         userProfile = getMyProfile()
     (template_data, template) = get_template('templates/profile.html')
     userProfileData = {}
     profile_data = json.loads(
         userProfile.profile) if userProfile.profile else {}
     for field in UserProfile.getJsonFields():
         userProfileData[field] = profile_data.setdefault(field, '')
     template_data['user'] = userProfile
     template_data['user_profile'] = userProfileData
     template_data['profileId'] = userProfile.email
     template_data['readonly'] = not (canEditThisProfile(userProfile))
     self.response.out.write(template.render(template_data))