authn: Fix priority of default values if some values are missing during POST
Normally this affects only the test suite but doesn't hurt to be correct :)
This commit is contained in:
parent
a1b5f9d602
commit
b5079c9ba9
1 changed files with 5 additions and 2 deletions
|
|
@ -56,10 +56,13 @@ class AuthnPluginViewBase(object):
|
|||
errors = errors or {}
|
||||
schema = self.plugin.get_settings_schema()
|
||||
|
||||
# Get default values for the form.
|
||||
# Compute default values for the form. Priority is:
|
||||
# 1. Passed to this method 2. DB value 3. Schema default
|
||||
for node in schema:
|
||||
db_value = self.plugin.get_setting_by_name(node.name)
|
||||
db_value = self.plugin.get_setting_by_name(
|
||||
node.name, colander.null)
|
||||
defaults.setdefault(node.name, db_value)
|
||||
defaults = schema.serialize(defaults)
|
||||
|
||||
template_context = {
|
||||
'defaults': defaults,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue