-
Notifications
You must be signed in to change notification settings - Fork 4
Fixed Values are not retained in forms (event, job and shift) #742 #1131
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1131 +/- ##
===========================================
- Coverage 87.18% 87.10% -0.08%
===========================================
Files 85 85
Lines 4057 4080 +23
Branches 237 238 +1
===========================================
+ Hits 3537 3554 +17
- Misses 450 455 +5
- Partials 70 71 +1
Continue to review full report at Codecov.
|
@gaurivn please review this. |
vms/event/views.py
Outdated
city = None | ||
for field in data.keys(): | ||
try: | ||
data[field] = data.get(field) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just do data.get(field, '')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SanketDG please review it again. Thanks.
@codesankalp codecov test is failing, did you check the tests locally? |
Yes, I don't know why, should I change anything @keshakaneria. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be due to the try-except block @codesankalp
@devkapilbansal in this commit I have removed the try except block inside for loop as mentioned by mentors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codesankalp you have some try except blocks in your code. Therefore you have to cover those in tests too, else find a way to reduce the numbers of try except blocks here.
One method that can be used here is .first()
method. Filter your queryset instead of get and fetch the first object. Then codecov will pass
@codesankalp like you can change this line |
Modified post view of forms to retain the values of submitted form when there is an error in form validation to increase users experience. Fixes #742
@devkapilbansal can you please check the build of Travis as I think the error in the build is not related to my commit. |
@gaurivn @keshakaneria @SanketDG can you please look into the problem |
Modified post view of forms to retain the values of submitted form
when there is an error in form validation to increase users experience.
Fixes #742
Screenshots
Before submission of form:
After submission of form:
Tasks done: