1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

initial commit of code

This commit is contained in:
Stefan Pratter
2018-11-08 19:45:21 +00:00
parent 5d7c69de38
commit 0edf47bbfb
370 changed files with 47054 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
from django.core.management.base import BaseCommand
from peeringdb_server.models import Sponsorship
import datetime
class Command(BaseCommand):
help = "Looks for expired sponsorships and sends a notification to sponsorship admin for recently expired sponsorships"
def log(self, msg):
print(msg)
def handle(self, *args, **options):
now = datetime.datetime.now()
for sponsorship in Sponsorship.objects.filter(end_date__lt=now):
if sponsorship.notify_date is None or sponsorship.notify_date < sponsorship.end_date:
b = sponsorship.notify_expiration()
#if b:
# self.log("Sent expiration notices for %s, expired on %s" % (sponsorship.org.name, sponsorship.end_date))