Commit d73a18f8 authored by buttle's avatar buttle

Fixed to left-overs from session param change

parent 22ec1e70
......@@ -31,7 +31,7 @@ babel = Babel(app)
csrf = CSRFProtect()
csrf.init_app(app)
app.config['APP_VERSION'] = 19
app.config['APP_VERSION'] = 20
app.config['SCHEMA_VERSION'] = 10
app.config['RESERVED_SLUGS'] = ['static', 'admin', 'admins', 'user', 'users', 'form', 'forms', 'site', 'sites']
......
......@@ -684,7 +684,7 @@ class Site(object):
self.site['blurb'] = {'markdown':escapeMarkdown(MDtext), 'html':markdown2HTML(MDtext)}
mongo.db.sites.save(self.site)
def saveDefaultFormFootNote(self, MDtext):
def savePersonalDataConsentText(self, MDtext):
self.site['personalDataConsent'] = { 'markdown':escapeMarkdown(MDtext),
'html':markdown2HTML(MDtext),
'enabled': self.site['personalDataConsent']['enabled']}
......
......@@ -195,7 +195,7 @@
<input id="save-edit" class="btn-success btn" type="button" value="{%trans%}Save{%endtrans%}" />
<input id="cancel-edit" class="btn-primary btn" type="button" value="{%trans%}Cancel{%endtrans%}" />
<p></p>
<form id="editor-form" action="/site/save-default-footnote" method="post">
<form id="editor-form" action="/site/save-personal-data-consent-text" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<textarea id="sm-editor" name="editor">{{ site.personalDataConsent['markdown'] }}</textarea>
</form>
......
......@@ -861,7 +861,7 @@ def new_user(token=None):
if validatedEmail == True:
# login an invited user
session['username']=user.username
session["user_id"]=str(user._id)
flash(gettext("Welcome!"), 'success')
return redirect(make_url_for('my_forms'))
else:
......@@ -869,7 +869,7 @@ def new_user(token=None):
smtpSendConfirmEmail(user)
return render_template('new-user.html', site=Site(), created=True)
session['username']=None
session["user_id"]=None
return render_template('new-user.html')
......@@ -945,7 +945,7 @@ def recover_password(token=None):
user.save()
# login the user
session['username']=user.username
session['user_id']=str(user._id)
return redirect(make_url_for('reset_password'))
return render_template('recover-password.html')
......@@ -1008,12 +1008,12 @@ def save_blurb():
return redirect(make_url_for('index'))
@app.route('/site/save-default-footnote', methods=['POST'])
@app.route('/site/save-personal-data-consent-text', methods=['POST'])
@admin_required
def save_footnote():
def save_data_consent():
if request.method == 'POST':
if 'editor' in request.form:
Site().saveDefaultFormFootNote(request.form['editor'])
Site().savePersonalDataConsentText(request.form['editor'])
flash(gettext("Text saved OK"), 'success')
return redirect(make_url_for('user_settings', username=g.current_user.username))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment