removing some printing
This commit is contained in:
@@ -65,8 +65,6 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
|||||||
# filename = os.path.abspath(fileobj.name)
|
# filename = os.path.abspath(fileobj.name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
filename = fileobj[6:]
|
filename = fileobj[6:]
|
||||||
if testing:
|
|
||||||
print('Attribute Error', filename)
|
|
||||||
|
|
||||||
|
|
||||||
# test if file exists and is not empty
|
# test if file exists and is not empty
|
||||||
@@ -74,12 +72,8 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
|||||||
with io.open('media/'+filename,'rb') as fop:
|
with io.open('media/'+filename,'rb') as fop:
|
||||||
line = fop.readline()
|
line = fop.readline()
|
||||||
except (IOError, UnicodeEncodeError):
|
except (IOError, UnicodeEncodeError):
|
||||||
if testing:
|
|
||||||
print('IOError',filename,'media/'+filename)
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if testing:
|
|
||||||
print('Creating workout from email')
|
|
||||||
|
|
||||||
# set user
|
# set user
|
||||||
if rower.user.is_staff and 'username' in uploadoptions:
|
if rower.user.is_staff and 'username' in uploadoptions:
|
||||||
@@ -134,8 +128,6 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
|||||||
except VirtualRace.DoesNotExist:
|
except VirtualRace.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if testing:
|
|
||||||
print('Workout id = {workoutid}'.format(workoutid=workoutid))
|
|
||||||
|
|
||||||
return workoutid
|
return workoutid
|
||||||
|
|
||||||
@@ -281,15 +273,6 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# move attachment and make workout
|
# move attachment and make workout
|
||||||
if testing:
|
|
||||||
try:
|
|
||||||
print(name)
|
|
||||||
except UnicodeEncodeError:
|
|
||||||
print("Unicode Error")
|
|
||||||
try:
|
|
||||||
print(attachment.document)
|
|
||||||
except UnicodeEncodeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
workoutid = processattachment(
|
workoutid = processattachment(
|
||||||
rower, attachment.document, name, uploadoptions,
|
rower, attachment.document, name, uploadoptions,
|
||||||
|
|||||||
Reference in New Issue
Block a user