*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects

Pre-fill "contact uploader" form partially if user is logged in

Merged Moser, Maximilian requested to merge mm/contact-uploader-default-values into master
1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
@@ -183,6 +183,11 @@ def create_blueprint(app):
"""Contact page for the contact's uploader."""
captcha = current_app.extensions["invenio-theme-tuw"].captcha
record = resolve_record(recid)
form_values = request.form.to_dict()
if current_user and not current_user.is_anonymous:
form_values.setdefault("name", current_user.user_profile.get("full_name"))
form_values.setdefault("email", current_user.email)
if record is None:
abort(404)
@@ -241,7 +246,7 @@ def create_blueprint(app):
submitted=submitted,
record=record,
captcha_failed=captcha_failed,
form_values=request.form,
form_values=form_values,
)
return response, 200 if not captcha_failed else 428
Loading