Generate Blender ID URL based on configuration

This commit is contained in:
Sybren A. Stüvel 2019-05-23 13:47:39 +02:00
parent cb8c9f1225
commit ec344ba894
2 changed files with 9 additions and 2 deletions

View File

@ -1,10 +1,12 @@
import json
import logging
import urllib.parse
from flask import Blueprint, flash, render_template
from flask_login import login_required, current_user
from werkzeug.exceptions import abort
from pillar import current_app
from pillar.web import system_util
from pillar.web.users import forms
from pillarsdk import User, exceptions as sdk_exceptions
@ -34,7 +36,12 @@ def profile():
message = json.loads(e.content)
flash(message)
return render_template('users/settings/profile.html', form=form, title='profile')
blender_id_endpoint = current_app.config['BLENDER_ID_ENDPOINT']
blender_profile_url = urllib.parse.urljoin(blender_id_endpoint, 'settings/profile')
return render_template('users/settings/profile.html',
form=form, title='profile',
blender_profile_url=blender_profile_url)
@blueprint.route('/roles')

View File

@ -37,7 +37,7 @@ style.
p {{ current_user.email }}
.form-group
| {{ _("Change your full name, email, and password at") }} #[a(href="https://www.blender.org/id/settings/profile",target='_blank') Blender ID].
| {{ _("Change your full name, email, and password at") }} #[a(href="{{ blender_profile_url }}",target='_blank') Blender ID].
| {% if current_user.badges_html %}
.form-group