diff --git a/README.md b/README.md index 3dcba26..e95351e 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,27 @@ Requirements * Developed to Django 1.7.1 +Please add it in local_settings.py (you have to create it, in the same folder of settings): +``` +# -*- coding: utf-8 -*- + + +EMAIL_HOST = '' +EMAIL_HOST_PASSWORD = '' +EMAIL_HOST_USER = 'youremail' +EMAIL_PORT = 25 +EMAIL_USE_TLS = True + +DEFAULT_FROM_EMAIL = "yourmeial@email.com" + + +ADMINS = (('Luís Bastião', 'yourock@email.com'), ) +BASE_URL = "http://localhost:8000/" + + +PROJECT_NAME = "Your project name" + +DOWNLOAD_FOLDER = "/dir/with/your/private/files" + +``` diff --git a/django_download_manager/download_manager/views.py b/django_download_manager/download_manager/views.py index c498014..7c2d0be 100644 --- a/django_download_manager/download_manager/views.py +++ b/django_download_manager/download_manager/views.py @@ -66,6 +66,9 @@ def get(self, request, hash_id=None,*args, **kwargs): print hash_id dr = DownloadRequest.objects.get(hashLink=hash_id) + if (not dr.pending): + html = "
This request has been already handled. Approved = %s " % str(dr.approved) + return HttpResponse(html) dr.pending = False dr.approved = True dr.save() @@ -76,6 +79,7 @@ def get(self, request, hash_id=None,*args, **kwargs): html_content += 'Please download: %sDear %s,
' % dr.communityUser.name + html_content += 'Your download request has been rejected.