don't overwrite first

This commit is contained in:
j 2017-06-14 17:45:12 +02:00
parent ca3909abed
commit b4f42256d8

View file

@ -785,7 +785,6 @@ class File(db.Model):
while utils.iexists(os.path.join(prefix, new_path)): while utils.iexists(os.path.join(prefix, new_path)):
h = self.sha1[:len(h)+1] h = self.sha1[:len(h)+1]
filename = '%s.%s.%s' % (title, h, extension) filename = '%s.%s.%s' % (title, h, extension)
first = unicodedata.normalize('NFD', author[0].upper())[0].upper()
new_path = os.path.join(first, author, filename) new_path = os.path.join(first, author, filename)
if current_path == os.path.join(prefix, new_path): if current_path == os.path.join(prefix, new_path):
break break