fixing zip - without uploadoptions
This commit is contained in:
@@ -94,15 +94,11 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
||||
uploadoptions['file'] = 'media/'+filename
|
||||
uploadoptions['title'] = title
|
||||
|
||||
try:
|
||||
print("Stravaid ",uploadoptions['stravaid'])
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
||||
url = settings.UPLOAD_SERVICE_URL
|
||||
if not testing:
|
||||
response = requests.post(url,data=uploadoptions)
|
||||
# print("Upload response status code",response.status_code, response.json())
|
||||
if response.status_code == 200:
|
||||
response_json = response.json()
|
||||
workoutid = [int(response_json['id'])]
|
||||
@@ -137,21 +133,6 @@ def processattachment(rower, fileobj, title, uploadoptions,testing=False):
|
||||
if testing:
|
||||
print('Workout id = {workoutid}'.format(workoutid=workoutid))
|
||||
|
||||
# if workoutid[0]:
|
||||
# link = settings.SITE_URL+reverse(
|
||||
# therower.defaultlandingpage,
|
||||
# kwargs = {
|
||||
# 'id':encoder.encode_hex(workoutid[0]),
|
||||
# }
|
||||
# )
|
||||
#
|
||||
# if not testing:
|
||||
# if therower.getemailnotifications and not therower.emailbounced:
|
||||
# email_sent = send_confirm(
|
||||
# therower.user, title, link,
|
||||
# uploadoptions
|
||||
# )
|
||||
|
||||
return workoutid
|
||||
|
||||
def get_from_address(message):
|
||||
@@ -272,6 +253,7 @@ class Command(BaseCommand):
|
||||
rower, datafile, title, uploadoptions,
|
||||
testing=testing
|
||||
)
|
||||
print(workoutid)
|
||||
except:
|
||||
print("Bad ZIP file")
|
||||
print(attachment.document.name)
|
||||
|
||||
Reference in New Issue
Block a user