Configured django-filer plugin. Added thumbnail of 630x200 to each post in post list view. Now when the user click on digitalglarus on contact form in ungleich landing page, he is redirected to digitalglarus home.Started to change index digitalglarus styleChanged ungleich css. Fixed image thumbnail on post item list . Added email template after an user has been charge for his monthly donation. Fixed command to make donations charge, if there is any error with one donator, it skip him and go on to the next.Added new header to digitalglarus page. Added menu to new digitalglarus landing
This commit is contained in:
parent
5fce858923
commit
fe52e61668
7 changed files with 314 additions and 32 deletions
|
|
@ -4,10 +4,12 @@ from datetime import datetime
|
|||
|
||||
from utils.stripe_utils import StripeUtils
|
||||
|
||||
from utils.mailer import BaseEmail
|
||||
from nosystemd.models import DonatorStatus, Donation
|
||||
from nosystemd.forms import DonationForm
|
||||
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Make the monthly stripe charge to all donators'
|
||||
CURRENCY = 'usd'
|
||||
|
|
@ -48,6 +50,7 @@ class Command(BaseCommand):
|
|||
print("--------- STRIPE PAYMENT ERROR ---------")
|
||||
print(context)
|
||||
print("-------------------------")
|
||||
continue
|
||||
# Create a donation
|
||||
charge = charge_response.get('response_object')
|
||||
donation_data = {
|
||||
|
|
@ -61,6 +64,22 @@ class Command(BaseCommand):
|
|||
donation_form = DonationForm(donation_data)
|
||||
if donation_form.is_valid():
|
||||
donation = donation_form.save()
|
||||
|
||||
context = {
|
||||
'donation': donation,
|
||||
'base_url': "{0}://{1}".format('https', 'dynamicweb.ungleich.ch')
|
||||
|
||||
}
|
||||
email_data = {
|
||||
'subject': 'Your donation have been charged',
|
||||
'to': donation.donator.user.email,
|
||||
'context': context,
|
||||
'template_name': 'donation_charge',
|
||||
'template_path': 'nosystemd/emails/'
|
||||
}
|
||||
email = BaseEmail(**email_data)
|
||||
email.send()
|
||||
|
||||
print("--------- PAYMENT DONATION SUCCESSFULL ---------")
|
||||
print("Donator: %s" % donation.donator.user.email)
|
||||
print("Amount: %s %s" % (donation.donation, self.CURRENCY))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue