Private
Public Access
1
0

removing some duplicate code

This commit is contained in:
Sander Roosendaal
2018-06-26 12:14:00 +02:00
parent 2350d5aedf
commit 0152c8d20b
14 changed files with 99 additions and 333 deletions

View File

@@ -46,30 +46,6 @@ from utils import geo_distance
from rowers.courseutils import coursetime_paths, coursetime_first,time_in_path
def get_course_timezone(course):
polygons = GeoPolygon.objects.filter(course = course)
points = GeoPoint.objects.filter(polygon = polygons[0])
lat = points[0].latitude
lon = points[0].longitude
tf = TimezoneFinder()
try:
timezone_str = tf.timezone_at(lng=lon,lat=lat)
except ValueError:
timezone_str = 'UTC'
if timezone_str is None:
timezone_str = tf.closest_timezone_at(lng=lon,lat=lat)
if timezone_str is None:
timezone_str = 'UTC'
return timezone_str
def crewnerdcourse(doc):
courses = []
for course in doc: