Fix display of duration_manual
This commit is contained in:
parent
12cc9025a0
commit
a1309c3738
|
@ -1,4 +1,5 @@
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
* Fix display of duration_manual
|
||||||
* Fix display of duration_calculated, display durations less than a minute
|
* Fix display of duration_calculated, display durations less than a minute
|
||||||
* Make the "Finish now?" button on session list work
|
* Make the "Finish now?" button on session list work
|
||||||
* Hide navigation bar items if there are no games/purchases/sessions
|
* Hide navigation bar items if there are no games/purchases/sessions
|
||||||
|
|
|
@ -12,5 +12,5 @@ COPY entrypoint.sh /
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
USER timetracker
|
USER timetracker
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
ENV VERSION_NUMBER 0.1.0-15-g6fe960b
|
ENV VERSION_NUMBER 0.1.0-16-g12cc902
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
|
@ -46,13 +46,13 @@ class Session(models.Model):
|
||||||
self.timestamp_end = datetime.now(ZoneInfo(settings.TIME_ZONE))
|
self.timestamp_end = datetime.now(ZoneInfo(settings.TIME_ZONE))
|
||||||
|
|
||||||
def duration_seconds(self):
|
def duration_seconds(self):
|
||||||
if self.timestamp_end == None or self.timestamp_start == None:
|
if self.duration_manual == None:
|
||||||
if self.duration_manual == None:
|
if self.timestamp_end == None or self.timestamp_start == None:
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
value = self.duration_manual
|
value = self.timestamp_end - self.timestamp_start
|
||||||
else:
|
else:
|
||||||
value = self.timestamp_end - self.timestamp_start
|
value = self.duration_manual
|
||||||
return value.total_seconds()
|
return value.total_seconds()
|
||||||
|
|
||||||
def duration_formatted(self):
|
def duration_formatted(self):
|
||||||
|
|
Loading…
Reference in New Issue