juliomalegria / django-chunked-upload

Upload large files to Django in multiple chunks, with the ability to resume if the upload is interrupted.
MIT No Attribution
214 stars 71 forks source link

delete_expired_uploads import error #12

Closed jdavid closed 9 years ago

jdavid commented 9 years ago

Hello,

Import Error:

$ ... delete_expired_uploads --help
Traceback (most recent call last):
  ...
  File "/.../django-chunked-upload/chunked_upload/management/commands/delete_expired_uploads.py", line 7, in <module>
    from .settings import EXPIRATION_DELTA
ImportError: No module named settings

Guess it should be from chunked_upload.settings import EXPIRATION_DELTA

PS: Thanks for this product!

jdavid commented 9 years ago

Worse, the query is just the opposite, instead of deleting expired uploads, it deletes non expired uploads:

-        qs = qs.filter(created_on__gte=(timezone.now() - EXPIRATION_DELTA))
+        qs = qs.filter(created_on__lt=(timezone.now() - EXPIRATION_DELTA))
juliomalegria commented 9 years ago

You're totally right about those two things! I'm so sorry. I'm going to fix them right away and make a new release.

juliomalegria commented 9 years ago

Fixed here: d99f9d7. New version (1.0.4) in PyPI.

Thanks @jdavid for pointing this out!