Private
Public Access
1
0

adding trailing slashes to post forms

This commit is contained in:
Sander Roosendaal
2019-01-05 13:29:39 +01:00
parent aa1b233798
commit e2cdb0af8e
25 changed files with 59 additions and 47 deletions

View File

@@ -746,7 +746,8 @@ class PlanSelectForm(forms.Form):
self.fields['plan'].empty_label = None self.fields['plan'].empty_label = None
if paymentprocessor: if paymentprocessor:
self.fields['plan'].queryset = PaidPlan.objects.filter( self.fields['plan'].queryset = PaidPlan.objects.filter(
paymentprocessor=paymentprocessor paymentprocessor=paymentprocessor,
active=True
).exclude( ).exclude(
shortname="basic" shortname="basic"
).order_by( ).order_by(
@@ -758,7 +759,8 @@ class PlanSelectForm(forms.Form):
except AttributeError: except AttributeError:
amount = 0 amount = 0
self.fields['plan'].queryset = PaidPlan.objects.filter( self.fields['plan'].queryset = PaidPlan.objects.filter(
paymentprocessor=rower.paymentprocessor paymentprocessor=rower.paymentprocessor,
active=True
).exclude( ).exclude(
price__lte=amount price__lte=amount
).order_by( ).order_by(

View File

@@ -568,6 +568,8 @@ class PaidPlan(models.Model):
choices=paymenttypes, choices=paymenttypes,
) )
active = models.BooleanField(default=True)
clubsize = models.IntegerField(default=0) clubsize = models.IntegerField(default=0)
def __unicode__(self): def __unicode__(self):

View File

@@ -10,30 +10,30 @@ def planstopaypal():
plan.external_id = None plan.external_id = None
plan.save() plan.save()
def initiaterowerplans(): #def initiaterowerplans():
rowers = Rower.objects.filter(paymenttype = 'recurring',paidplan = None) # rowers = Rower.objects.filter(paymenttype = 'recurring',paidplan = None)
for r in rowers: # for r in rowers:
r.paymentprocessor = 'paypal' # r.paymentprocessor = 'paypal'
r.save() # r.save()
def setrowerplans(): #def setrowerplans():
rowers = Rower.objects.all() # rowers = Rower.objects.all()
for r in rowers: # for r in rowers:
paidplans = PaidPlan.objects.filter( # paidplans = PaidPlan.objects.filter(
shortname = r.rowerplan, # shortname = r.rowerplan,
paymenttype = r.paymenttype, # paymenttype = r.paymenttype,
clubsize = r.clubsize, # clubsize = r.clubsize,
paymentprocessor=r.paymentprocessor) # paymentprocessor=r.paymentprocessor)
if paidplans: # if paidplans:
r.paidplan = paidplans[0] # r.paidplan = paidplans[0]
r.save() # r.save()
else: # else:
try: # try:
print 'Could not set plan for ',r.user.username # print 'Could not set plan for ',r.user.username
except: # except:
pass # pass
def is_existing_customer(rower): def is_existing_customer(rower):
if rower.country is not None and rower.customer_id is not None and rower.country != '': if rower.country is not None and rower.customer_id is not None and rower.country != '':

View File

@@ -19,7 +19,8 @@
<p>Unless specified otherwise, the payments on the <p>Unless specified otherwise, the payments on the
recurring payment plans are annual. The prices are specified recurring payment plans are annual. The prices are specified
as a price per year. as a price per year. You can downgrade or cancel your
plan at any time in your <a href="/rowers/me/edit/">settings</a>.
</p> </p>
<table width="100%"> <table width="100%">

View File

@@ -1,3 +1,4 @@
{% extends "newbase.html" %} {% extends "newbase.html" %}
{% block title %}Rowsandall Paid Membership{% endblock title %} {% block title %}Rowsandall Paid Membership{% endblock title %}
{% load rowerfilters %} {% load rowerfilters %}

View File

@@ -56,7 +56,7 @@
<a href="/rowers/downgrade">Change Downgrade</a> <a href="/rowers/downgrade">Change Downgrade</a>
</li> </li>
<li class="grid_4"> <li class="grid_4">
<form id="payment-form" method="post" action="/rowers/downgradecheckouts" <form id="payment-form" method="post" action="/rowers/downgradecheckouts/"
autocomplete="off"> autocomplete="off">
<section> <section>
<label for="amount"> <label for="amount">

View File

@@ -83,7 +83,7 @@
{{ the_div|safe }} {{ the_div|safe }}
</li> </li>
<li class="grid_2"> <li class="grid_2">
<form enctype="multipart/form-data" action="/rowers/fitness-progress/user/{{ rower.user.id }}" method="post"> <form enctype="multipart/form-data" action="/rowers/fitness-progress/user/{{ rower.user.id }}/" method="post">
<table> <table>
{{ form.as_table }} {{ form.as_table }}
</table> </table>

View File

@@ -42,7 +42,7 @@
</p> </p>
<p> <p>
<form method="POST" action="/rowers/me/delete" class="padding"> <form method="POST" action="/rowers/me/delete/" class="padding">
{% csrf_token %} {% csrf_token %}
<input id="id_delete_user" type="hidden" name="delete_user" value="True"> <input id="id_delete_user" type="hidden" name="delete_user" value="True">
<input class="button red small" type="submit" name="action" value="DELETE ACCOUNT"> <input class="button red small" type="submit" name="action" value="DELETE ACCOUNT">

View File

@@ -80,10 +80,10 @@
</p> </p>
{% if team %} {% if team %}
<p> <p>
<form id="searchform" action="/rowers/list-workouts/team/{{ team.id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}" <form id="searchform" action="/rowers/list-workouts/team/{{ team.id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}/"
method="get" accept-charset="utf-8"> method="get" accept-charset="utf-8">
{% else %} {% else %}
<form id="searchform" action="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}" <form id="searchform" action="/rowers/list-workouts/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}/"
method="get" accept-charset="utf-8"> method="get" accept-charset="utf-8">
{% endif %} {% endif %}
{{ searchform }} {{ searchform }}

View File

@@ -27,7 +27,7 @@
</div> </div>
</li> </li>
<li class="grid_2"> <li class="grid_2">
<form enctype="multipart/form-data" action="/rowers/user-multiflex/user/{{ userid }}" method="post"> <form enctype="multipart/form-data" action="/rowers/user-multiflex/user/{{ userid }}/" method="post">
{% csrf_token %} {% csrf_token %}
<table> <table>
{{ chartform.as_table }} {{ chartform.as_table }}

View File

@@ -12,6 +12,11 @@
hosting costs, we have created paid plans offering extended hosting costs, we have created paid plans offering extended
functionality. functionality.
</p> </p>
<p>
All plans are valid for a year. Recurring payment plans will automatically
bill you at the start of a new 12 month period. You can stop your plan
at any time in your <a href="/rowers/me/edit/">settings</a>.
</p>
<p> <p>
<table class="plantable shortpadded" width="80%"> <table class="plantable shortpadded" width="80%">

View File

@@ -65,7 +65,7 @@
<a href="/rowers/billing">Change Order</a> <a href="/rowers/billing">Change Order</a>
</li> </li>
<li class="grid_4"> <li class="grid_4">
<form id="payment-form" method="post" action="/rowers/checkouts" <form id="payment-form" method="post" action="/rowers/checkouts/"
autocomplete="off"> autocomplete="off">
<section> <section>
<label for="amount"> <label for="amount">

View File

@@ -235,7 +235,7 @@
<h2>BrainTree Experimental Corner</h2> <h2>BrainTree Experimental Corner</h2>
<form id="payment-form" method="post" action="/rowers/checkouts" <form id="payment-form" method="post" action="/rowers/checkouts/"
autocomplete="off"> autocomplete="off">
<section> <section>
<label for="amount"> <label for="amount">

View File

@@ -47,7 +47,7 @@
<a href="/rowers/sessions/{{ thesession.id }}/clone/?when={{ timeperiod }}">Clone</a> <a href="/rowers/sessions/{{ thesession.id }}/clone/?when={{ timeperiod }}">Clone</a>
</p> </p>
<input class="button green" <input class="button green"
action="/rowers/sessions/{{ thesession.id }}/edit/user/{{ rower.user.id }}" type="submit" value="Save"> action="/rowers/sessions/{{ thesession.id }}/edit/user/{{ rower.user.id }}/" type="submit" value="Save">
</form> </form>
</li> </li>

View File

@@ -114,7 +114,7 @@
{% csrf_token %} {% csrf_token %}
<input name="piece" class="button green" <input name="piece" class="button green"
formaction="/rowers/ote-bests/user/{{ id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}" formaction="/rowers/ote-bests/user/{{ id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}/"
type="submit" value="Add"> type="submit" value="Add">
</form> </form>
</li>/ </li>/

View File

@@ -12,7 +12,7 @@
<ul class="main-content"> <ul class="main-content">
<li class="grid_2"> <li class="grid_2">
<p> <p>
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/split" method="post"> <form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/split/" method="post">
<table width=100%> <table width=100%>
{{ form.as_table }} {{ form.as_table }}
</table> </table>

View File

@@ -8,7 +8,7 @@
{% endif %} {% endif %}
<h1>Stroke Data for workout</h1> <h1>Stroke Data for workout</h1>
<form enctype="application/json" action="/rowers/api/workouts/{{ id }}/strokedata" method="post"> <form enctype="application/json" action="/rowers/api/workouts/{{ id }}/strokedata/" method="post">
<table> <table>
{{ form.as_table }} {{ form.as_table }}
</table> </table>

View File

@@ -38,7 +38,7 @@
<p> <p>
See the how-to <a href="#howto">at the bottom of this page</a> for details on how to use this form. See the how-to <a href="#howto">at the bottom of this page</a> for details on how to use this form.
</p> </p>
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals" method="post"> <form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals/" method="post">
<table width=100%> <table width=100%>
{{ form.as_table }} {{ form.as_table }}
</table> </table>
@@ -73,7 +73,7 @@
</li> </li>
<li class="grid_2"> <li class="grid_2">
<h1>Updated Summary</h1> <h1>Updated Summary</h1>
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals" method="post"> <form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals/" method="post">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="{{ savebutton }}" value="{{ intervalstring }}"> <input type="hidden" name="{{ savebutton }}" value="{{ intervalstring }}">
<input type="hidden" name="nrintervals" value={{ nrintervals }}> <input type="hidden" name="nrintervals" value={{ nrintervals }}>
@@ -101,7 +101,7 @@
<li class="grid_2"> <li class="grid_2">
<h1>Detailed Summary Edit</h1> <h1>Detailed Summary Edit</h1>
<p>This is still experimental and there are known bugs. Use at your own risk. Nothing is stored permanently until you hit Save in the Updated Summary section. You can use the restore original button to restore the original values.</p> <p>This is still experimental and there are known bugs. Use at your own risk. Nothing is stored permanently until you hit Save in the Updated Summary section. You can use the restore original button to restore the original values.</p>
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals" method="post"> <form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/editintervals/" method="post">
<table width=100%> <table width=100%>
<thead> <thead>
<tr> <tr>

View File

@@ -20,7 +20,8 @@
<p>Unless specified otherwise, the payments on the <p>Unless specified otherwise, the payments on the
recurring payment plans are annual. The prices are specified recurring payment plans are annual. The prices are specified
as a price per year. as a price per year. You can downgrade or cancel your
plan at any time in your <a href="/rowers/me/edit/">settings</a>.
</p> </p>
<table width="100%"> <table width="100%">

View File

@@ -65,7 +65,7 @@
<a href="/rowers/upgrade">Change Upgrade</a> <a href="/rowers/upgrade">Change Upgrade</a>
</li> </li>
<li class="grid_4"> <li class="grid_4">
<form id="payment-form" method="post" action="/rowers/upgradecheckouts" <form id="payment-form" method="post" action="/rowers/upgradecheckouts/"
autocomplete="off"> autocomplete="off">
<section> <section>
<label for="amount"> <label for="amount">

View File

@@ -80,7 +80,7 @@
</li> </li>
<li class="grid_2 maxheight"> <li class="grid_2 maxheight">
<form enctype="multipart/form-data" action="/rowers/user-boxplot/user/{{ theuser.id }}" method="post"> <form enctype="multipart/form-data" action="/rowers/user-boxplot/user/{{ theuser.id }}/" method="post">
{% if workouts %} {% if workouts %}

View File

@@ -103,7 +103,7 @@
</form> </form>
</li> </li>
<li class="grid_2 maxheight"> <li class="grid_2 maxheight">
<form enctype="multipart/form-data" action="/rowers/user-multiflex/user/{{ theuser.id }}" method="post"> <form enctype="multipart/form-data" action="/rowers/user-multiflex/user/{{ theuser.id }}/" method="post">
{% if workouts %} {% if workouts %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/> <input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>

View File

@@ -54,7 +54,7 @@
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
<form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/comment" method="post"> <form enctype="multipart/form-data" action="/rowers/workout/{{ workout.id }}/comment/" method="post">
<table width=100%> <table width=100%>
{{ form.as_table }} {{ form.as_table }}
</table> </table>

View File

@@ -70,7 +70,7 @@
<ul class="main-content"> <ul class="main-content">
<li class="grid_2 maxheight"> <li class="grid_2 maxheight">
<form enctype="multipart/form-data" action="/rowers/workouts-join" method="post"> <form enctype="multipart/form-data" action="/rowers/workouts-join/" method="post">
{% if workouts %} {% if workouts %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/> <input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
@@ -127,10 +127,10 @@
</li> </li>
<li class="grid_2"> <li class="grid_2">
{% if team %} {% if team %}
<form id="searchform" action="/rowers/workouts-join-select/team/{{ team.id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}" <form id="searchform" action="/rowers/workouts-join-select/team/{{ team.id }}/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}/"
method="get" accept-charset="utf-8"> method="get" accept-charset="utf-8">
{% else %} {% else %}
<form id="searchform" action="/rowers/workouts-join-select/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}" <form id="searchform" action="/rowers/workouts-join-select/{{ startdate|date:"Y-m-d" }}/{{ enddate|date:"Y-m-d" }}/"
method="get" accept-charset="utf-8"> method="get" accept-charset="utf-8">
{% endif %} {% endif %}
{{ searchform }} {{ searchform }}

Binary file not shown.