Skip to content

Commit c0c7e5a

Browse files
Merge pull request #25 from DiptoChakrabarty/development
Development
2 parents bc2fa3f + 79eb1ae commit c0c7e5a

4 files changed

Lines changed: 21 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ pip install -r requirements.txt
5757
```
5858
4. Remove site.db file to start fresh database
5959
```sh
60-
rm resume/site.db
60+
rm resume/site.db
6161
```
6262
5. Setup Env Variables
6363

6464
create file .env inside folder resume
6565

6666
Add the following
6767
```sh
68-
MAIL_USERNAME="{{ your gmail username }}"
69-
PASSWORD="{{ your password }}"
68+
MAIL_USERNAME="{{ your gmail username }}"
69+
PASSWORD="{{ your password }}"
7070
```
7171

7272
6. Run webserver
7373
```sh
74-
python3 app.py
74+
python3 app.py
7575
```
7676

7777
# Contributing

resume/forms.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ class useredu(FlaskForm):
7777
validators=[DataRequired()])
7878
end = DateField('End Date', format='%Y-%m-%d',
7979
validators=[DataRequired()])
80+
81+
def validate_end(form, field):
82+
if field.data < form.start.data:
83+
raise ValidationError("End date cannot be earlier than start date.")
84+
8085
cgpa = StringField("CGPA",
8186
validators=[DataRequired()])
8287
submit = SubmitField("Add Education")
@@ -92,6 +97,11 @@ class userexp(FlaskForm):
9297
validators=[DataRequired()])
9398
endexp = DateField('End Date', format='%Y-%m-%d',
9499
validators=[DataRequired()])
100+
101+
def validate_endexp(form, field):
102+
if field.data < form.startexp.data:
103+
raise ValidationError("End date cannot be earlier than start date.")
104+
95105
content = TextAreaField("Description",
96106
validators=[DataRequired(),Length(min=15)])
97107
submit = SubmitField("Add Work Experience")
@@ -104,6 +114,11 @@ class userpro(FlaskForm):
104114
validators=[DataRequired()])
105115
endpro = DateField('End Date', format='%Y-%m-%d',
106116
validators=[DataRequired()])
117+
118+
def validate_endpro(form, field):
119+
if field.data < form.startpro.data:
120+
raise ValidationError("End date cannot be earlier than start date.")
121+
107122
description = TextAreaField("Description",
108123
validators=[Length(min=10)])
109124
url = StringField("Project Url",
@@ -163,11 +178,5 @@ class resetpassword(FlaskForm):
163178

164179

165180

166-
167-
168-
169-
170-
171-
172181

173182

resume/site.db

0 Bytes
Binary file not shown.

test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
app = Flask(__name__)
1212

13-
app.config['SECRET_KEY'] = os.urandom(32).hex()
13+
app.config['SECRET_KEY'] = 'e23739c67eade607c64f90c3ebb479ca'
14+
1415
'''app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
1516
1617
db = SQLAlchemy(app)'''

0 commit comments

Comments
 (0)