jeanphix / django-resumable

django backend for resumable.js xhr uploads.
61 stars 21 forks source link

Fix for a prefix removal bug #5

Closed chubz closed 8 years ago

chubz commented 9 years ago

I've had a case where lstrip matched more than just the size prefix and removed some number I had in the original filename. Doing str.replace here might be better since it would just match and replace the prefix once with an empty string.

chubz commented 9 years ago

@jeanphix any news on this?

madhukar93 commented 9 years ago

Is this repo still being maintained ?

jeanphix commented 9 years ago

@chubz @madhukar93 Sorry...

Think it's still wrong, as it replaces anywhere within the filename, better to be something like:

import re
self.filename = re.sub('^%s_' % unicode(size), '', filepath)

@chubz Could you fix?

chubz commented 8 years ago

@jeanphix Sorry I'm late in checking my github notifications. Hope it's good now and you can merge it! Thanks on the suggestion yeah seems like a better solution.

jeanphix commented 8 years ago

@chubz Thanks :+1: