0001-franceconnect-add-scopes-setting-39286.patch
hobo/franceconnect/forms.py | ||
---|---|---|
33 | 33 |
client_secret = forms.CharField( |
34 | 34 |
label=_('Client Secret'), |
35 | 35 |
widget=forms.TextInput(attrs={'size': 64})) |
36 |
scopes = forms.MultipleChoiceField( |
|
37 |
label=_('Scopes'), |
|
38 |
choices=[ |
|
39 |
('given_name', _('given name')), |
|
40 |
('gender', _('gender')), |
|
41 |
('birthdate', _('birthdate')), |
|
42 |
('birthcountry', _('birthcountry')), |
|
43 |
('birthplace', _('birthplace')), |
|
44 |
('family_name', _('family name')), |
|
45 |
('email', _('email')), |
|
46 |
('preferred_username', _('usual family name')), |
|
47 |
('address', _('address')), |
|
48 |
('phone', _('phone')), |
|
49 |
('identite_pivot', _('identite_pivot')), |
|
50 |
('profile', _('profile')), |
|
51 |
('birth', _('birth profile')), |
|
52 |
], |
|
53 |
widget=forms.RadioSelect) |
|
36 | 54 | |
37 | 55 | |
38 | 56 |
class EnableForm(forms.Form): |
hobo/franceconnect/views.py | ||
---|---|---|
43 | 43 | |
44 | 44 |
initial['client_id'] = get_variable('A2_FC_CLIENT_ID').value |
45 | 45 |
initial['client_secret'] = get_variable('A2_FC_CLIENT_SECRET').value |
46 |
initial['scopes'] = get_variable('A2_FC_SCOPES').value or 'profile' |
|
46 | 47 | |
47 | 48 |
return initial |
48 | 49 | |
... | ... | |
79 | 80 |
variable.value = 'true' |
80 | 81 |
variable.save() |
81 | 82 | |
83 |
variable = get_variable('A2_FC_SCOPES') |
|
84 |
variable.json = form.cleaned_data['scopes'] |
|
85 |
variable.save() |
|
86 | ||
82 | 87 |
return super(HomeView, self).form_valid(form) |
83 | 88 | |
84 | 89 |
def get_context_data(self, **kwargs): |
85 |
- |