Private
Public Access
1
0

fix tests

This commit is contained in:
Sander Roosendaal
2022-02-17 20:22:42 +01:00
parent 337e0ff558
commit ac9b541a28
2 changed files with 6 additions and 6 deletions

View File

@@ -479,8 +479,8 @@ def garmin_getworkout(garminid, r, activity):
utc_offset = datetime.timedelta(seconds=offset) utc_offset = datetime.timedelta(seconds=offset)
now = datetime.datetime.now(pytz.utc) now = datetime.datetime.now(pytz.utc)
zones = [ttz.zone for ttz in map(pytz.timezone, pytz.all_timezones_set) zones = [ttz.zone for ttz in map(
if now.astimezone(tz).utcoffset() == utc_offset] pytz.timezone, pytz.all_timezones_set) if now.astimezone(ttz).utcoffset() == utc_offset]
if r.defaulttimezone in zones: # pragma: no cover if r.defaulttimezone in zones: # pragma: no cover
thetimezone = r.defaulttimezone thetimezone = r.defaulttimezone
elif len(zones): elif len(zones):
@@ -494,8 +494,7 @@ def garmin_getworkout(garminid, r, activity):
day=startdatetime.day, day=startdatetime.day,
hour=startdatetime.hour, hour=startdatetime.hour,
minute=startdatetime.minute, minute=startdatetime.minute,
second=startdatetime.second, second=startdatetime.second,).astimezone(pytz.timezone(thetimezone))
).astimezone(pytz.timezone(thetimezone))
w.startdatetime = startdatetime w.startdatetime = startdatetime
w.starttime = w.startdatetime.time() w.starttime = w.startdatetime.time()

View File

@@ -503,8 +503,9 @@ def getagegrouprecord(age, sex='male', weightcategory='hwt',
def polygon_to_path(polygon, debug=True): def polygon_to_path(polygon, debug=True):
pid = polygon[0] pid = polygon[0]
query = "SELECT id, latitude, longitude FROM rowers_geopoint WHERE polygon_id = {pid}'\ query = "SELECT id, latitude, longitude FROM rowers_geopoint WHERE polygon_id = {pid}"\
' ORDER BY order_in_poly ASC".format(pid=pid) " ORDER BY order_in_poly ASC".format(
pid=pid)
if debug: if debug:
engine = create_engine(database_url_debug, echo=False) engine = create_engine(database_url_debug, echo=False)
else: # pragma: no cover else: # pragma: no cover