Private
Public Access
1
0

removing some printing

This commit is contained in:
Sander Roosendaal
2021-04-15 18:13:41 +02:00
parent 8ca9446e48
commit 456e9df73e

View File

@@ -65,8 +65,6 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
# filename = os.path.abspath(fileobj.name)
except AttributeError:
filename = fileobj[6:]
if testing:
print('Attribute Error', filename)
# 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:
line = fop.readline()
except (IOError, UnicodeEncodeError):
if testing:
print('IOError',filename,'media/'+filename)
return 0
if testing:
print('Creating workout from email')
# set user
if rower.user.is_staff and 'username' in uploadoptions:
@@ -134,8 +128,6 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
except VirtualRace.DoesNotExist:
pass
if testing:
print('Workout id = {workoutid}'.format(workoutid=workoutid))
return workoutid
@@ -281,15 +273,6 @@ class Command(BaseCommand):
else:
# move attachment and make workout
if testing:
try:
print(name)
except UnicodeEncodeError:
print("Unicode Error")
try:
print(attachment.document)
except UnicodeEncodeError:
pass
workoutid = processattachment(
rower, attachment.document, name, uploadoptions,