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 /arduino_blog | |
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
Diffstat (limited to 'arduino_blog')
-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 |
3 files changed, 22 insertions, 22 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> |