diff options
author | Sashi20 | 2020-03-02 15:49:55 +0530 |
---|---|---|
committer | Sashi20 | 2020-03-02 15:49:55 +0530 |
commit | 204f6ff6518a8aec1b4d374104616caa41713e8a (patch) | |
tree | 37a17342e5764293454ae0e6e768e30f91c54f39 | |
parent | aa26e64d6092f0e4b25fb6ac74c9dcde649fb951 (diff) | |
download | arduino_projects_website-204f6ff6518a8aec1b4d374104616caa41713e8a.tar.gz arduino_projects_website-204f6ff6518a8aec1b4d374104616caa41713e8a.tar.bz2 arduino_projects_website-204f6ff6518a8aec1b4d374104616caa41713e8a.zip |
Remove attachments field from proposal form
-rw-r--r-- | arduino_blog/forms.py | 20 | ||||
-rw-r--r-- | arduino_blog/migrations/0006_remove_proposal_attachment.py | 17 | ||||
-rw-r--r-- | arduino_blog/templates/submit-cfp.html | 7 | ||||
-rwxr-xr-x | arduino_projects_website/config.py | 2 | ||||
-rw-r--r-- | arduino_projects_website/settings.py | 4 |
5 files changed, 25 insertions, 25 deletions
diff --git a/arduino_blog/forms.py b/arduino_blog/forms.py index 20c3d2f..4945b79 100644 --- a/arduino_blog/forms.py +++ b/arduino_blog/forms.py @@ -237,9 +237,9 @@ class AbstractProposalForm(forms.ModelForm): error_messages={ 'required': 'About the author field required.'}, ) - attachment = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), - label='Please upload relevant documents (if any)', - required=False,) + # attachment = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), + # label='Please upload relevant documents (if any)', + # required=False,) title_of_the_project = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Title of the Project'}), required=True, error_messages={ @@ -272,17 +272,3 @@ class AbstractProposalForm(forms.ModelForm): super(AbstractProposalForm, self).__init__(*args, **kwargs) self.fields['completion_date'].disabled = True self.fields['completion_date'].initial = (datetime.date.today() + relativedelta(months=1)) - - def clean_attachment(self): - import os - cleaned_data = self.cleaned_data - attachment = cleaned_data.get('attachment', None) - if attachment: - ext = os.path.splitext(attachment.name)[1] - valid_extensions = ['.pdf'] - if not ext in valid_extensions: - raise forms.ValidationError( - u'File not supported! Only .pdf file is accepted') - if attachment.size > (5*1024*1024): - raise forms.ValidationError('File size exceeds 5MB') - return attachment diff --git a/arduino_blog/migrations/0006_remove_proposal_attachment.py b/arduino_blog/migrations/0006_remove_proposal_attachment.py new file mode 100644 index 0000000..1cb0463 --- /dev/null +++ b/arduino_blog/migrations/0006_remove_proposal_attachment.py @@ -0,0 +1,17 @@ +# Generated by Django 3.0.3 on 2020-03-02 10:16 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('arduino_blog', '0005_auto_20200228_1241'), + ] + + operations = [ + migrations.RemoveField( + model_name='proposal', + name='attachment', + ), + ] diff --git a/arduino_blog/templates/submit-cfp.html b/arduino_blog/templates/submit-cfp.html index 988bc60..6e20b5c 100644 --- a/arduino_blog/templates/submit-cfp.html +++ b/arduino_blog/templates/submit-cfp.html @@ -43,12 +43,9 @@ <div id="charNum"></div> </label> </div> + <div class="form-group"> - <label for="attachment">Attachments:</label> - {% render_field proposal_form.attachment %} - </div> - <div class="form-group"> - <label for="abstract">Expected completion date (Aprox. 1 month) + <label for="abstract">Expected completion date (Approx. 1 month) <span style="color:red;">*</span>: </label> diff --git a/arduino_projects_website/config.py b/arduino_projects_website/config.py index 197236f..fcf9bdf 100755 --- a/arduino_projects_website/config.py +++ b/arduino_projects_website/config.py @@ -8,7 +8,7 @@ SYSADMINS = 'email@email' SYS_SERVER_EMAIL = 'email@email' ALLOWED_HOSTS_USER = ['127.0.0.1'] -SECRET_KEY_USER = '7*guu@#er)o2543z-5df$e%)_&&3!ez$!x7$!qtyr4ejj+p*0&' # enter secret key +SECRET_KEY_USER = '' # enter secret key DEBUG_USER = True TO_EMAIL = 'email@email' diff --git a/arduino_projects_website/settings.py b/arduino_projects_website/settings.py index 78ac346..d9e11b9 100644 --- a/arduino_projects_website/settings.py +++ b/arduino_projects_website/settings.py @@ -132,8 +132,8 @@ STATIC_ROOT = 'arduino_blog/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads') MEDIA_URL = "/downloads/" -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -#EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend" +#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend" EMAIL_FILE_PATH = os.path.join(BASE_DIR, "sent_emails") ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" SENDER_EMAIL = SENDER_EMAIL |