Ejemplo n.º 1
0
def editprofile(request):
	user=users.get_current_user()
	params=request.GET
	newUser=User()
	newUser.user_id=params['user_id']
	newUser.name=params['name']
	newUser.description=params['description']
	newUser.avatar=params['avatar']
	newUser.handle=user.nickname()
	newUser.put()
	return render_to_response('main/profile/profile.html', {"name": newUser.name, "nickname":newUser.handle, "user_id":newUser.user_id, "description":newUser.description, "avatar":newUser.avatar})
Ejemplo n.º 2
0
def submitsignup(request):
	user=users.get_current_user()
	params=request.GET
	user_id=params['user_id']
	name=params['name']
	description=params['description']
	avatar=params['avatar']
	handle=user.nickname()
	query = GqlQuery("SELECT * FROM User WHERE handle = :hndl", hndl=str(handle))
	result=query.get()
	if result is None:
		newUser= User()
		newUser.user_id=user_id
		newUser.name=name
		newUser.description=description
		newUser.handle=handle
		newUser.avatar=avatar
		newUser.followercount=0
		newUser.put()
		return render_to_response('main/signup/submitaccount.html',{"user_id":user_id, "name": name, "description": description ,"nickname": handle} )
	else:
		return render_to_response('main/signup/signuperror.html', {"user_id":result.user_id, "name": result.name, "nickname": result.handle} )