update docker deployment and changing seed kandang name
This commit is contained in:
1 parent
76f4d0106a
commit
74dd3faf60
40 files changed
+1253
-122
No files matched your search
@@ -1,3 +1,5 @@
|
||||
from datetime import date
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from wagtail.admin.panels import FieldPanel
|
||||
@@ -126,10 +128,16 @@ class Cycle(models.Model):
|
||||
|
||||
@property
|
||||
def current_day(self) -> int:
|
||||
from django.utils import timezone
|
||||
from apps.operations.services.visibility import visible_through_date
|
||||
|
||||
today = timezone.localdate()
|
||||
if today <= self.start_date:
|
||||
return 1
|
||||
elapsed = (today - self.start_date).days + 1
|
||||
effective = visible_through_date()
|
||||
if effective < self.start_date:
|
||||
return 0
|
||||
elapsed = (effective - self.start_date).days + 1
|
||||
return min(max(elapsed, 1), self.total_days)
|
||||
|
||||
@property
|
||||
def visible_through_date(self) -> date:
|
||||
from apps.operations.services.visibility import visible_through_date as cutoff_date
|
||||
|
||||
return cutoff_date()
|
||||
Reference in new issue
Block a user