Show More
@@ -80,15 +80,17 b' class AuthnPluginViewBase(object):' | |||||
80 | View that validates and stores the plugin settings. |
|
80 | View that validates and stores the plugin settings. | |
81 | """ |
|
81 | """ | |
82 | schema = self.plugin.get_settings_schema() |
|
82 | schema = self.plugin.get_settings_schema() | |
|
83 | data = self.request.params | |||
|
84 | ||||
83 | try: |
|
85 | try: | |
84 |
valid_data = schema.deserialize( |
|
86 | valid_data = schema.deserialize(data) | |
85 | except colander.Invalid, e: |
|
87 | except colander.Invalid, e: | |
86 | # Display error message and display form again. |
|
88 | # Display error message and display form again. | |
87 | self.request.session.flash( |
|
89 | self.request.session.flash( | |
88 | _('Errors exist when saving plugin settings. ' |
|
90 | _('Errors exist when saving plugin settings. ' | |
89 | 'Please check the form inputs.'), |
|
91 | 'Please check the form inputs.'), | |
90 | queue='error') |
|
92 | queue='error') | |
91 | defaults = schema.flatten(self.request.params) |
|
93 | defaults = {key: data[key] for key in data if key in schema} | |
92 | return self.settings_get(errors=e.asdict(), defaults=defaults) |
|
94 | return self.settings_get(errors=e.asdict(), defaults=defaults) | |
93 |
|
95 | |||
94 | # Store validated data. |
|
96 | # Store validated data. |
General Comments 0
You need to be logged in to leave comments.
Login now