Mercurial > sat_legacy_website
comparison sat_website/views.py @ 40:dfe7139dae0a
add links to the statutes and rules of the association in the adhesion form
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 03 Feb 2015 15:14:42 +0100 |
parents | d2c45f4ba57e |
children | 3e460ca969d2 |
comparison
equal
deleted
inserted
replaced
39:d2c45f4ba57e | 40:dfe7139dae0a |
---|---|
86 context["SOCIAL_CONTRACT"] = social_contract.get_social_contract() | 86 context["SOCIAL_CONTRACT"] = social_contract.get_social_contract() |
87 elif category == "downloads": | 87 elif category == "downloads": |
88 context["projects_infos"] = utils.get_projects_infos(PROJECTS_INFOS) | 88 context["projects_infos"] = utils.get_projects_infos(PROJECTS_INFOS) |
89 elif category == "adhesion": | 89 elif category == "adhesion": |
90 context.update(utils.get_asso_finance_status()) | 90 context.update(utils.get_asso_finance_status()) |
91 context.update(utils.get_asso_urls()) | |
91 elif category == "adhesion_form": | 92 elif category == "adhesion_form": |
92 if request.method == 'POST': | 93 if request.method == 'POST': |
93 form = forms.RegistrationForm(request.POST) | 94 form = forms.RegistrationForm(request.POST) |
95 form.process_submitted_data() | |
94 if form.is_valid(): | 96 if form.is_valid(): |
95 category = 'thank_you' | 97 category = 'thank_you' |
96 else: | 98 else: |
97 form = forms.RegistrationForm(initial={'subscription_amount': 10, | 99 form = forms.RegistrationForm(initial={'subscription_amount': 10, |
98 'payment_method': 'card'}) | 100 'payment_method': 'card'}) |
99 context['form'] = form | 101 context['form'] = form |
102 context.update(utils.get_asso_urls()) | |
100 | 103 |
101 def all_keys(cats): | 104 def all_keys(cats): |
102 subcats = [value[1].keys() for value in cats.values() if isinstance(value, tuple)] | 105 subcats = [value[1].keys() for value in cats.values() if isinstance(value, tuple)] |
103 return sum(subcats, cats.keys()) | 106 return sum(subcats, cats.keys()) |
104 | 107 |