diff --git a/wotstats/init.py b/wotstats/init.py index 533b2e3..2ad29ef 100644 --- a/wotstats/init.py +++ b/wotstats/init.py @@ -13,7 +13,8 @@ def init_app(): app.config['OPENID_FS_STORE_PATH'] = 'tmp' # app.config['WG_ID'] = '502910c1c785c3c7ca2e83c9e89bde02' - app.config['WG_OPENID_URL'] = 'https://eu.wargaming.net/id/openid/' + # app.config['WG_OPENID_URL'] = 'https://eu.wargaming.net/id/openid/' + app.config['WG_OPENID_URL'] = 'https://wargaming.net/id/openid/' # , safe_roots=[] oid.init_app(app) diff --git a/wotstats/templates/pages/account/index.html b/wotstats/templates/pages/account/index.html index fe8cf26..f8b1e60 100644 --- a/wotstats/templates/pages/account/index.html +++ b/wotstats/templates/pages/account/index.html @@ -1,5 +1,35 @@ {% extends 'layouts/main.html' %} {% block content %} -{{account_statistics}} +{# {account_statistics} #} + + + + {% endblock %} diff --git a/wotstats/templates/pages/login.html b/wotstats/templates/pages/login.html index 633d51f..07a7a7c 100644 --- a/wotstats/templates/pages/login.html +++ b/wotstats/templates/pages/login.html @@ -2,12 +2,12 @@ {% block title %}Create Profile{% endblock %} {% block content %}

Sign in

-
+ {% if error %}

Error: {{ error }}

{% endif %}

- OpenID: - - - + Wargaming OpenID: + + +

{% endblock %} diff --git a/wotstats/views/account.py b/wotstats/views/account.py index e1c575e..35bafa7 100644 --- a/wotstats/views/account.py +++ b/wotstats/views/account.py @@ -25,11 +25,19 @@ def __get_player_personal_data(): @pages_account.route('/') def index(): + if not g.user: + return redirect(url_for('pages_home.index')) + account_statistics = __get_player_personal_data() - return render_template('pages/account/index.html', account_statistics=account_statistics) + return render_template( + 'pages/account/index.html', + account_statistics=account_statistics) @pages_account.route('/statistics.html') def statistics(): + if not g.user: + return redirect(url_for('pages_home.index')) + return render_template( 'pages/account/statistics.html') diff --git a/wotstats/views/home.py b/wotstats/views/home.py index 5564dee..3e37e79 100644 --- a/wotstats/views/home.py +++ b/wotstats/views/home.py @@ -30,7 +30,7 @@ def parse_wargaming_openid_url(url): @pages_home.route('/', defaults={'page': 'index'}) @pages_home.route('/') def index(page): - z = session['openid'] + # z = session['openid'] return render_template('pages/index.html')