def index(request): logger.info('index') logger.info('username = '******'form':form} return show(request, c)
def update(request): logger.info('update') if request.method == 'POST': user_form = UserForm(request.POST, instance=SERVICES.getUserInfo(request.user.username)) result = SERVICES.updateUserInfo(user_form) if not result == 'success': fail_form = UserForm(request.POST) c = {'form':fail_form} c.update({'form_message':MSGS.UPD_FAIL}) return show(request, c) c = {'form_message': MSGS.UPD_SUCCESS} c.update({'form':user_form}) return show(request, c)