Show More
@@ -45,27 +45,6 b' class AuthnPluginViewBase(object):' | |||||
45 | self.context = context |
|
45 | self.context = context | |
46 | self.plugin = context.plugin |
|
46 | self.plugin = context.plugin | |
47 |
|
47 | |||
48 | # TODO: Think about replacing the htmlfill stuff. |
|
|||
49 | def _render_and_fill(self, template, template_context, request, |
|
|||
50 | form_defaults, validation_errors): |
|
|||
51 | """ |
|
|||
52 | Helper to render a template and fill the HTML form fields with |
|
|||
53 | defaults. Also displays the form errors. |
|
|||
54 | """ |
|
|||
55 | # Render template to string. |
|
|||
56 | html = render(template, template_context, request=request) |
|
|||
57 |
|
||||
58 | # Fill the HTML form fields with default values and add error messages. |
|
|||
59 | html = formencode.htmlfill.render( |
|
|||
60 | html, |
|
|||
61 | defaults=form_defaults, |
|
|||
62 | errors=validation_errors, |
|
|||
63 | prefix_error=False, |
|
|||
64 | encoding="UTF-8", |
|
|||
65 | force_defaults=False) |
|
|||
66 |
|
||||
67 | return html |
|
|||
68 |
|
||||
69 | def settings_get(self, errors={}): |
|
48 | def settings_get(self, errors={}): | |
70 | """ |
|
49 | """ | |
71 | View that displays the plugin settings as a form. |
|
50 | View that displays the plugin settings as a form. |
General Comments 0
You need to be logged in to leave comments.
Login now