fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0a7090f
)
club fixes.
author
Radek Czajka
<rczajka@rczajka.pl>
Thu, 1 Jun 2023 13:15:19 +0000
(15:15 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Thu, 1 Jun 2023 13:15:19 +0000
(15:15 +0200)
src/club/forms.py
patch
|
blob
|
history
src/club/payment_methods.py
patch
|
blob
|
history
src/club/templates/club/2022/donation_step4.html
patch
|
blob
|
history
src/club/templates/club/2022/donation_step_base.html
patch
|
blob
|
history
src/club/templates/payu/rec_widget.html
patch
|
blob
|
history
src/club/templatetags/club.py
patch
|
blob
|
history
diff --git
a/src/club/forms.py
b/src/club/forms.py
index
75213fc
..
675c18d
100644
(file)
--- a/
src/club/forms.py
+++ b/
src/club/forms.py
@@
-135,7
+135,11
@@
class DonationStep1Form(forms.ModelForm):
'monthly'
]
'monthly'
]
-
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ club = models.Club.objects.first()
+ self.fields['custom_amount'].widget.attrs['min'] = club.min_amount
+
def clean(self):
state = {}
state['monthly'] = self.cleaned_data['switch'] == 'monthly'
def clean(self):
state = {}
state['monthly'] = self.cleaned_data['switch'] == 'monthly'
diff --git
a/src/club/payment_methods.py
b/src/club/payment_methods.py
index
6bb6f8e
..
8f5ff6b
100644
(file)
--- a/
src/club/payment_methods.py
+++ b/
src/club/payment_methods.py
@@
-32,12
+32,13
@@
class PayU(PaymentMethod):
def __init__(self, pos_id):
self.pos_id = pos_id
def __init__(self, pos_id):
self.pos_id = pos_id
- def invite_widget(self, schedule):
+ def invite_widget(self, schedule
, request
):
return render_to_string(
'club/payment/payu_invite.html',
{
'schedule': schedule,
return render_to_string(
'club/payment/payu_invite.html',
{
'schedule': schedule,
- }
+ },
+ request=request
)
def initiate(self, request, schedule):
)
def initiate(self, request, schedule):
@@
-66,7
+67,7
@@
class PayURe(PaymentMethod):
def initiate(self, request, schedule):
return reverse('club_payu_rec_payment', args=[schedule.key])
def initiate(self, request, schedule):
return reverse('club_payu_rec_payment', args=[schedule.key])
- def invite_widget(self, schedule):
+ def invite_widget(self, schedule
, request
):
from . import forms
pos = POSS[self.pos_id]
widget_args = {
from . import forms
pos = POSS[self.pos_id]
widget_args = {
@@
-93,9
+94,10
@@
class PayURe(PaymentMethod):
'pos': POSS[self.pos_id],
'widget_args': widget_args,
'widget_sig': widget_sig,
'pos': POSS[self.pos_id],
'widget_args': widget_args,
'widget_sig': widget_sig,
- }
+ },
+ request=request
)
)
-
+
def pay(self, request, schedule):
# Create order, put it and see what happens next.
from .models import PayUOrder
def pay(self, request, schedule):
# Create order, put it and see what happens next.
from .models import PayUOrder
@@
-146,12
+148,13
@@
class PayPal(PaymentMethod):
is_recurring = True
is_onetime = False
is_recurring = True
is_onetime = False
- def invite_widget(self, schedule):
+ def invite_widget(self, schedule
, request
):
return render_to_string(
'club/payment/paypal_invite.html',
{
'schedule': schedule,
return render_to_string(
'club/payment/paypal_invite.html',
{
'schedule': schedule,
- }
+ },
+ request=request
)
def initiate(self, request, schedule):
)
def initiate(self, request, schedule):
diff --git
a/src/club/templates/club/2022/donation_step4.html
b/src/club/templates/club/2022/donation_step4.html
index
f257111
..
fd14ca7
100644
(file)
--- a/
src/club/templates/club/2022/donation_step4.html
+++ b/
src/club/templates/club/2022/donation_step4.html
@@
-9,7
+9,7
@@
Zajrzyj teraz do e-maila. Tam znajdziesz link,
który powiąże płatność z Twoim kontem użytkownika Wolnych Lektur.
</p>
Zajrzyj teraz do e-maila. Tam znajdziesz link,
który powiąże płatność z Twoim kontem użytkownika Wolnych Lektur.
</p>
- <a href="
#
">Wracam do lektur</a>
+ <a href="
/
">Wracam do lektur</a>
</div>
</div>
{% endblock %}
</div>
</div>
{% endblock %}
diff --git
a/src/club/templates/club/2022/donation_step_base.html
b/src/club/templates/club/2022/donation_step_base.html
index
d4319ee
..
a87b6c3
100644
(file)
--- a/
src/club/templates/club/2022/donation_step_base.html
+++ b/
src/club/templates/club/2022/donation_step_base.html
@@
-20,7
+20,7
@@
</div>
<div class="l-checkout__support__footer">
<p>Dołącz do naszych stałych <strong>darczyńców</strong>!</p>
</div>
<div class="l-checkout__support__footer">
<p>Dołącz do naszych stałych <strong>darczyńców</strong>!</p>
- <p>Potrzebujemy <strong>500</strong> regularnych darczyńców by Wolne Lektury mogły działać!</p>
+ <p>Potrzebujemy <strong>500</strong> regularnych darczyńców
,
by Wolne Lektury mogły działać!</p>
</div>
</div>
</div>
</div>
diff --git
a/src/club/templates/payu/rec_widget.html
b/src/club/templates/payu/rec_widget.html
index
89b114b
..
c02cc08
100644
(file)
--- a/
src/club/templates/payu/rec_widget.html
+++ b/
src/club/templates/payu/rec_widget.html
@@
-1,6
+1,6
@@
<h3>Podaj dane karty płatniczej</h3>
<div class="iframe">
<h3>Podaj dane karty płatniczej</h3>
<div class="iframe">
- <form id="theform" method='POST'>
+ <form id="theform" method='POST'
action='{% url "club_payu_rec_payment" schedule.key %}'
>
{% csrf_token %}
{{ form }}
</form>
{% csrf_token %}
{{ form }}
</form>
diff --git
a/src/club/templatetags/club.py
b/src/club/templatetags/club.py
index
be7dda9
..
92fb5ca
100644
(file)
--- a/
src/club/templatetags/club.py
+++ b/
src/club/templatetags/club.py
@@
-80,6
+80,6
@@
def club_monthly_missing_since(start, target):
monthly=True, payed_at__gte=start).count()
monthly=True, payed_at__gte=start).count()
-@register.simple_tag
-def invite_payment(payment_method, schedule):
- return payment_method.invite_widget(schedule)
+@register.simple_tag
(takes_context=True)
+def invite_payment(
context,
payment_method, schedule):
+ return payment_method.invite_widget(schedule
, context['request']
)