Example #1
0
def manage_account_submit(request,*args,**kwargs):
	action = kwargs.get('action')
	action = common_tags.codify(action)
	if action == 'change_contact_info':
		return change_contact_info(request,**kwargs)
	elif action == 'change_login_details':
		return change_login_details(request,**kwargs)
Example #2
0
def process_change_login(request,user):
	data = dict (
		username = user.username,
		email = user.username,
	)
	form = common_forms.UserForm(data=data)
	t = template.loader.get_template('accounts/change_password.html')
	c = template.Context({'form': form})
	html = t.render(c)
	tab_title = 'Change Login Details'
	action = common_tags.codify(tab_title)
	return html,tab_title,action
Example #3
0
def process_change_contact_info(request,user):
	data = args_utils.concatenate_dicts(user.get_profile().address.__dict__,user.get_profile().__dict__)
	data['address_type'] = data.get('address_type_id')
	data['country'] = data.get('country_id')
	data['province'] = data.get('province_id')
	data['supplier_type'] = data.get('supplier_type_id')
	data['buyer_type'] = data.get('client_type_id')
	form = common_forms.ContactInfoForm(data=data)
	t = template.loader.get_template('accounts/change_contact.html')
	c = template.Context({'form': form, 'request' : request})
	html = t.render(c)
	tab_title = 'Change Contact Info'
	action = common_tags.codify(tab_title)
	return html,tab_title,action