better warning on auto import/export settings for basic users
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Automatic Synchronization with other fitness sites</td>
|
<td>Automatic Synchronization with other fitness sites</td>
|
||||||
<td>✔</td>
|
<td> </td>
|
||||||
<td>✔</td>
|
<td>✔</td>
|
||||||
<td>✔</td>
|
<td>✔</td>
|
||||||
<td>✔</td>
|
<td>✔</td>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
{% block title %}Change Rower Export Settings{% endblock %}
|
{% block title %}Change Rower Export Settings{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<h1>Import and Export Settings for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
|
<h1>Import and Export Settings for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
|
||||||
|
|
||||||
|
|||||||
@@ -318,6 +318,8 @@ def rower_exportsettings_view(request,userid=0):
|
|||||||
form = RowerExportForm(request.POST)
|
form = RowerExportForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
cd = form.cleaned_data
|
cd = form.cleaned_data
|
||||||
|
if r.rowerplan == 'basic':
|
||||||
|
messages.error(request,'These settings can only be set if you are a user on one of the <a href="/rowers/paidplans">paid plans</a>.')
|
||||||
|
|
||||||
for attr, value in cd.items():
|
for attr, value in cd.items():
|
||||||
doset = True
|
doset = True
|
||||||
@@ -327,6 +329,8 @@ def rower_exportsettings_view(request,userid=0):
|
|||||||
doset = False
|
doset = False
|
||||||
except KeyError:
|
except KeyError:
|
||||||
doset = True
|
doset = True
|
||||||
|
if r.rowerplan == 'basic':
|
||||||
|
doset = False
|
||||||
if not doset:
|
if not doset:
|
||||||
before = getattr(r,attr)
|
before = getattr(r,attr)
|
||||||
if before == value:
|
if before == value:
|
||||||
@@ -334,7 +338,8 @@ def rower_exportsettings_view(request,userid=0):
|
|||||||
if doset:
|
if doset:
|
||||||
setattr(r, attr, value)
|
setattr(r, attr, value)
|
||||||
else:
|
else:
|
||||||
messages.error(request,'Could not set '+attr+'. You need to create the connection first.')
|
if r.rowerplan != 'basic':
|
||||||
|
messages.error(request,'Could not set '+attr+'. You need to create the connection first.')
|
||||||
|
|
||||||
r.save()
|
r.save()
|
||||||
messages.info(request,'Settings saved')
|
messages.info(request,'Settings saved')
|
||||||
|
|||||||
Reference in New Issue
Block a user