Fixing wait period for offers, fixing #5
This commit is contained in:
parent
e8f8e2372d
commit
38fd830eab
2 changed files with 7 additions and 6 deletions
|
@ -62,11 +62,11 @@ class Inquiry(models.Model):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def in_bidding(self):
|
def in_bidding(self):
|
||||||
return self.active and (self.bidding_end < timezone.now())
|
return self.active and (self.bidding_end > timezone.now())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def in_selection(self):
|
def in_selection(self):
|
||||||
return self.active and (self.auction_end < timezone.now())
|
return self.active and (self.auction_end > timezone.now()) and not self.in_bidding
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def active(self):
|
def active(self):
|
||||||
|
@ -107,4 +107,4 @@ class Offer(models.Model):
|
||||||
def inquiry_expiry(sender, instance, created, **kwargs):
|
def inquiry_expiry(sender, instance, created, **kwargs):
|
||||||
if not instance.expiry:
|
if not instance.expiry:
|
||||||
instance.expiry = min(instance.arrival, (timezone.now() + timedelta(hours=int(getValue("auction.payment_period", 168)))).date())
|
instance.expiry = min(instance.arrival, (timezone.now() + timedelta(hours=int(getValue("auction.payment_period", 168)))).date())
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
|
@ -15,13 +15,14 @@
|
||||||
<div class="payment-success-text">
|
<div class="payment-success-text">
|
||||||
<h1>Angebote vergleichen</h1>
|
<h1>Angebote vergleichen</h1>
|
||||||
{% if object.offer_set.all %}
|
{% if object.offer_set.all %}
|
||||||
Zu deiner Anfrage sind bislang {{ object.offer_set.all|len }} Angebote eingegangen. Aber gedulde dich bitte noch ein wenig – vielleicht werden es ja noch mehr! Deine Angebote werden freigeschalten in:
|
Zu deiner Anfrage sind bislang {{ object.offer_set.all|length }} Angebote eingegangen. Aber gedulde dich bitte noch ein wenig – vielleicht werden es ja noch mehr! Deine Angebote werden freigeschalten in:
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-warning alert-dismissible text-center" role="alert">
|
<div class="alert alert-warning alert-dismissible text-center" role="alert">
|
||||||
Zu deiner Anfrage sind bislang noch keine Angebote eingegangen. Aber ein bisschen Zeit ist ja noch – deine Angebote werden freigeschalten in:
|
Zu deiner Anfrage sind bislang noch keine Angebote eingegangen. Aber ein bisschen Zeit ist ja noch – deine Angebote werden freigeschaltet in:
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="bidding_end" value="{{ object.bidding_end|date:"U" }}">
|
<input type="hidden" id="bidding_end" value="{{ object.bidding_end|date:"U" }}">
|
||||||
<div id="counter" class="cf"></div>
|
<div id="counter" class="cf"></div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div><!-- end columns -->
|
</div><!-- end columns -->
|
||||||
</div><!-- end row -->
|
</div><!-- end row -->
|
||||||
|
@ -32,4 +33,4 @@
|
||||||
|
|
||||||
{% block "scripts" %}
|
{% block "scripts" %}
|
||||||
<script src="{% static "vendor/js/jquery.countdown.js" %}"></script>
|
<script src="{% static "vendor/js/jquery.countdown.js" %}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue