better file names fit files
This commit is contained in:
@@ -140,8 +140,10 @@ def handle_uploaded_image(i): # pragma: no cover
|
||||
|
||||
def handle_uploaded_file(f):
|
||||
fname = f.name
|
||||
timestr = uuid.uuid4().hex[:10]+'-'+time.strftime("%Y%m%d-%H%M%S")
|
||||
fname = timestr+'-'+fname
|
||||
ext = fname.split('.')[-1]
|
||||
fname = '%s.%s' % (uuid.uuid4(),ext)
|
||||
#timestr = uuid.uuid4().hex[:10]+'-'+time.strftime("%Y%m%d-%H%M%S")
|
||||
#fname = timestr+'-'+fname
|
||||
fname2 = 'media/'+fname
|
||||
with open(fname2,'wb+') as destination:
|
||||
for chunk in f.chunks():
|
||||
|
||||
Reference in New Issue
Block a user