from django.db.models.signals import pre_save
from .models import Bid, TreasuryConfig
from datetime import datetime, timedelta
from django.conf import settings


treasury = TreasuryConfig.objects.get(id=settings.TREASURY_CONFIG)
def check_bid_window(sender, instance, **kwargs):
    if datetime.now() < timedelta(minutes=treasury.bid_window):
        instance.save()
    else:
        raise Exception("Bidding Closed")
    
pre_save.connect(check_bid_window, sender=Bid)
67526a444fd05d754c08fbf6aa90530249693bcd
<mask token>


def check_bid_window(sender, instance, **kwargs):
    if datetime.now() < timedelta(minutes=treasury.bid_window):
        instance.save()
    else:
        raise Exception('Bidding Closed')


<mask token>

<mask token>


def check_bid_window(sender, instance, **kwargs):
    if datetime.now() < timedelta(minutes=treasury.bid_window):
        instance.save()
    else:
        raise Exception('Bidding Closed')


pre_save.connect(check_bid_window, sender=Bid)

<mask token>
treasury = TreasuryConfig.objects.get(id=settings.TREASURY_CONFIG)


def check_bid_window(sender, instance, **kwargs):
    if datetime.now() < timedelta(minutes=treasury.bid_window):
        instance.save()
    else:
        raise Exception('Bidding Closed')


pre_save.connect(check_bid_window, sender=Bid)

from django.db.models.signals import pre_save
from .models import Bid, TreasuryConfig
from datetime import datetime, timedelta
from django.conf import settings
treasury = TreasuryConfig.objects.get(id=settings.TREASURY_CONFIG)


def check_bid_window(sender, instance, **kwargs):
    if datetime.now() < timedelta(minutes=treasury.bid_window):
        instance.save()
    else:
        raise Exception('Bidding Closed')


pre_save.connect(check_bid_window, sender=Bid)

from django.db.models.signals import pre_save
from .models import Bid, TreasuryConfig
from datetime import datetime, timedelta
from django.conf import settings


treasury = TreasuryConfig.objects.get(id=settings.TREASURY_CONFIG)
def check_bid_window(sender, instance, **kwargs):
    if datetime.now() < timedelta(minutes=treasury.bid_window):
        instance.save()
    else:
        raise Exception("Bidding Closed")
    
pre_save.connect(check_bid_window, sender=Bid)