|
|
|
@ -218,7 +218,7 @@ def alter(partID):
|
|
|
|
|
datasheet_file = request.files['datasheet-file']
|
|
|
|
|
datasheet_filename = secure_filename(datasheet_file.filename)
|
|
|
|
|
i = 1
|
|
|
|
|
while os.path.isfile('srv/datasheets/' + datasheet_filename):
|
|
|
|
|
while os.path.isfile('/srv/datasheets/' + datasheet_filename):
|
|
|
|
|
datasheet_filename = datasheet_filename[:-4] + str(i) + '.pdf'
|
|
|
|
|
i += 1
|
|
|
|
|
datasheet_file.save('/srv/datasheets/' + datasheet_filename)
|
|
|
|
@ -249,7 +249,7 @@ def alter(partID):
|
|
|
|
|
datasheet_file = request.files['datasheet-file']
|
|
|
|
|
datasheet_filename = secure_filename(datasheet_file.filename)
|
|
|
|
|
i = 1
|
|
|
|
|
while os.path.isfile('srv/datasheets/' + datasheet_filename):
|
|
|
|
|
while os.path.isfile('/srv/datasheets/' + datasheet_filename):
|
|
|
|
|
datasheet_filename = datasheet_filename[:-4] + str(i) + '.pdf'
|
|
|
|
|
i += 1
|
|
|
|
|
datasheet_file.save('/srv/datasheets/' + datasheet_filename)
|
|
|
|
|