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)
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user