Skip to content

Commit

Permalink
bugfix change event view
Browse files Browse the repository at this point in the history
  • Loading branch information
jedie committed Jul 19, 2018
1 parent 8dcb2ad commit 602e95b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion for_runners/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from django_tools.models import UpdateInfoBaseModel, UpdateTimeBaseModel

# https://github.com/jedie/django-for-runners
from for_runners.gpx_tools.humanize import human_distance
from for_runners.gpx_tools.humanize import human_distance, human_seconds
from for_runners.models import DisciplineModel

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -188,6 +188,10 @@ def get_duration_s(self):
duration += (self.duration.hour * 60 * 60)
return duration

def human_duration(self):
if self.duration:
return human_seconds(self.get_duration_s())

def get_pace_s(self):
if self.duration:
pace = (self.get_duration_s() / 60) / float(self.distance_km)
Expand Down

0 comments on commit 602e95b

Please sign in to comment.