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

View File

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

View File

@@ -10,30 +10,30 @@ def planstopaypal():
plan.external_id = None
plan.save()
def initiaterowerplans():
rowers = Rower.objects.filter(paymenttype = 'recurring',paidplan = None)
for r in rowers:
r.paymentprocessor = 'paypal'
r.save()
#def initiaterowerplans():
# rowers = Rower.objects.filter(paymenttype = 'recurring',paidplan = None)
# for r in rowers:
# r.paymentprocessor = 'paypal'
# r.save()
def setrowerplans():
rowers = Rower.objects.all()
#def setrowerplans():
# rowers = Rower.objects.all()
for r in rowers:
paidplans = PaidPlan.objects.filter(
shortname = r.rowerplan,
paymenttype = r.paymenttype,
clubsize = r.clubsize,
paymentprocessor=r.paymentprocessor)
# for r in rowers:
# paidplans = PaidPlan.objects.filter(
# shortname = r.rowerplan,
# paymenttype = r.paymenttype,
# clubsize = r.clubsize,
# paymentprocessor=r.paymentprocessor)
if paidplans:
r.paidplan = paidplans[0]
r.save()
else:
try:
print 'Could not set plan for ',r.user.username
except:
pass
# if paidplans:
# r.paidplan = paidplans[0]
# r.save()
# else:
# try:
# print 'Could not set plan for ',r.user.username
# except:
# pass
def is_existing_customer(rower):
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
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>
<table width="100%">

View File

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

View File

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

View File

@@ -83,7 +83,7 @@
{{ the_div|safe }}
</li>
<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>
{{ form.as_table }}
</table>

View File

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

View File

@@ -80,10 +80,10 @@
</p>
{% if team %}
<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">
{% 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">
{% endif %}
{{ searchform }}

View File

@@ -27,7 +27,7 @@
</div>
</li>
<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 %}
<table>
{{ chartform.as_table }}

View File

@@ -12,6 +12,11 @@
hosting costs, we have created paid plans offering extended
functionality.
</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>
<table class="plantable shortpadded" width="80%">

View File

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

View File

@@ -235,7 +235,7 @@
<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">
<section>
<label for="amount">

View File

@@ -47,7 +47,7 @@
<a href="/rowers/sessions/{{ thesession.id }}/clone/?when={{ timeperiod }}">Clone</a>
</p>
<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>
</li>

View File

@@ -114,7 +114,7 @@
{% csrf_token %}
<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">
</form>
</li>/

View File

@@ -12,7 +12,7 @@
<ul class="main-content">
<li class="grid_2">
<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%>
{{ form.as_table }}
</table>

View File

@@ -8,7 +8,7 @@
{% endif %}
<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>
{{ form.as_table }}
</table>

View File

@@ -38,7 +38,7 @@
<p>
See the how-to <a href="#howto">at the bottom of this page</a> for details on how to use this form.
</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%>
{{ form.as_table }}
</table>
@@ -73,7 +73,7 @@
</li>
<li class="grid_2">
<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 %}
<input type="hidden" name="{{ savebutton }}" value="{{ intervalstring }}">
<input type="hidden" name="nrintervals" value={{ nrintervals }}>
@@ -101,7 +101,7 @@
<li class="grid_2">
<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>
<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%>
<thead>
<tr>

View File

@@ -20,7 +20,8 @@
<p>Unless specified otherwise, the payments on the
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>
<table width="100%">

View File

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

View File

@@ -80,7 +80,7 @@
</li>
<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 %}

View File

@@ -103,7 +103,7 @@
</form>
</li>
<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 %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>

View File

@@ -54,7 +54,7 @@
</div>
</div>
{% 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%>
{{ form.as_table }}
</table>

View File

@@ -70,7 +70,7 @@
<ul class="main-content">
<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 %}
<input type="checkbox" onClick="toggle(this)" /> Toggle All<br/>
@@ -127,10 +127,10 @@
</li>
<li class="grid_2">
{% 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">
{% 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">
{% endif %}
{{ searchform }}

Binary file not shown.