Avoid error when Store cannot be reached.
This commit is contained in:
@@ -358,10 +358,14 @@ def billing():
|
|||||||
groups.append(group.name)
|
groups.append(group.name)
|
||||||
|
|
||||||
store_user = store.fetch_subscription_info(user.email)
|
store_user = store.fetch_subscription_info(user.email)
|
||||||
|
if store_user is None:
|
||||||
|
expiration_date = 'Unable to reach Blender Store to check'
|
||||||
|
else:
|
||||||
|
expiration_date = store_user['expiration_date'][:10]
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
'users/settings/billing.html',
|
'users/settings/billing.html',
|
||||||
store_user=store_user, groups=groups, title='billing')
|
expiration_date=expiration_date, groups=groups, title='billing')
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route('/terms-and-conditions')
|
@blueprint.route('/terms-and-conditions')
|
||||||
|
@@ -22,13 +22,13 @@ style(type='text/css').
|
|||||||
| Your subscription is active
|
| Your subscription is active
|
||||||
h4 Thank you for supporting us!
|
h4 Thank you for supporting us!
|
||||||
hr
|
hr
|
||||||
p Subscription expires on: <strong>{{ store_user['expiration_date'][:10] }}</strong>
|
p Subscription expires on: <strong>{{ expiration_date }}</strong>
|
||||||
| {% else %}
|
| {% else %}
|
||||||
h3.subscription-missing
|
h3.subscription-missing
|
||||||
i.pi-info
|
i.pi-info
|
||||||
a(href="{{renew_url}}") Your subscription can be renewed
|
a(href="{{renew_url}}") Your subscription can be renewed
|
||||||
hr
|
hr
|
||||||
p.text-danger Subscription expired on: <strong>{{ store_user['expiration_date'][:10] }}</strong>
|
p.text-danger Subscription expired on: <strong>{{ expiration_date }}</strong>
|
||||||
p
|
p
|
||||||
a.btn.btn-success(href="{{renew_url}}") Renew now
|
a.btn.btn-success(href="{{renew_url}}") Renew now
|
||||||
| {% endif %}
|
| {% endif %}
|
||||||
|
Reference in New Issue
Block a user