app/soc/views/site/user/profile.py
changeset 215 d020c95b17b1
parent 210 d05444cf4641
child 229 a46c238be8db
equal deleted inserted replaced
214:21f94815fc85 215:d020c95b17b1
   144                 'User with that link name not found.')            
   144                 'User with that link name not found.')            
   145     # else: form was not valid
   145     # else: form was not valid
   146   # else:  # method == 'GET'
   146   # else:  # method == 'GET'
   147 
   147 
   148   if user:
   148   if user:
   149     # User entity found, so populate form with existing User information            
   149     # User entity found, so populate form with existing User information
   150     # context['found_user'] = user
   150     # context['found_user'] = user
   151     form = LookupForm(initial={'id': user.id.email,
   151     form = LookupForm(initial={'id': user.id.email,
   152                                'link_name': user.link_name})
   152                                'link_name': user.link_name})
   153 
   153 
   154     if request.path.endswith('lookup'):
   154     if request.path.endswith('lookup'):
   296                 values=profile.SUBMIT_MESSAGES))
   296                 values=profile.SUBMIT_MESSAGES))
   297 
   297 
   298         # populate form with the existing User entity
   298         # populate form with the existing User entity
   299         form = EditForm(initial={ 'key_name': user.key().name(),
   299         form = EditForm(initial={ 'key_name': user.key().name(),
   300             'id': user.id.email, 'link_name': user.link_name,
   300             'id': user.id.email, 'link_name': user.link_name,
   301             'nick_name': user.nick_name, 'is_developer': user.is_developer})       
   301             'nick_name': user.nick_name, 'is_developer': user.is_developer})
   302       else:
   302       else:
   303         if request.GET.get(profile.SUBMIT_MSG_PARAM_NAME):
   303         if request.GET.get(profile.SUBMIT_MSG_PARAM_NAME):
   304           # redirect to aggressively remove 'Profile saved' query parameter
   304           # redirect to aggressively remove 'Profile saved' query parameter
   305           return http.HttpResponseRedirect(request.path)
   305           return http.HttpResponseRedirect(request.path)
   306           
   306