fixing #490
This commit is contained in:
@@ -30,7 +30,7 @@ queue = django_rq.get_queue('default')
|
||||
queuelow = django_rq.get_queue('low')
|
||||
queuehigh = django_rq.get_queue('high')
|
||||
|
||||
from rowers.mytypes import workouttypes,boattypes,otwtypes,workoutsources
|
||||
from rowers.mytypes import workouttypes,boattypes,otwtypes,workoutsources, workouttypes_ordered
|
||||
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
@@ -156,13 +156,14 @@ def gettypeoptions_body2(uploadoptions,body):
|
||||
testerb = re.compile('^(boat)')
|
||||
for line in body.splitlines():
|
||||
if tester.match(line.lower()):
|
||||
for typ,verb in workouttypes:
|
||||
for typ,verb in workouttypes_ordered.items():
|
||||
str1 = '^(workout)(.*)({a})'.format(
|
||||
a = typ.lower()
|
||||
)
|
||||
testert = re.compile(str1)
|
||||
if testert.match(line.lower()):
|
||||
uploadoptions['workouttype'] = typ
|
||||
break
|
||||
if testerb.match(line.lower()):
|
||||
for typ,verb in boattypes:
|
||||
str1 = '^(boat)(.*)({a})'.format(
|
||||
@@ -170,7 +171,8 @@ def gettypeoptions_body2(uploadoptions,body):
|
||||
)
|
||||
testert = re.compile(str1)
|
||||
if testert.match(line.lower()):
|
||||
uploadoptions['boattype'] = typ
|
||||
uploadoptions['boattype'] = typ
|
||||
break
|
||||
|
||||
return uploadoptions
|
||||
|
||||
@@ -286,11 +288,13 @@ def getplotoptions(uploadoptions,value):
|
||||
|
||||
def gettype(uploadoptions,value,key):
|
||||
workouttype = 'rower'
|
||||
for typ,verb in workouttypes:
|
||||
for typ,verb in workouttypes_ordered.items():
|
||||
if value == typ:
|
||||
workouttype = typ
|
||||
break
|
||||
if value == verb:
|
||||
workouttype = typ
|
||||
break
|
||||
|
||||
uploadoptions[key] = workouttype
|
||||
|
||||
|
||||
Reference in New Issue
Block a user