MLH-Fellowship / orientation-project-python-23.SUM.A

Orientation Project (Python) for 23.SUM.A
1 stars 12 forks source link

Separated logic into utils file and fixed indexing bug #27

Closed ahmedehabb closed 1 year ago

ahmedehabb commented 1 year ago

I separated the logic of getting a certain model by index into functions in a separate file called utils.py since i will use the same code in editing existing models. Also there is a bug in indexing (if 0 <= index < len(data["education"]) -1 ) this will exclude the last one which is incorrect. so i removed the -1

ahmedehabb commented 1 year ago

i still get linter error due to the functions in app.py not returning something outside of the if conditions. should I add return jsonify({}) as a last statement in each function.

ahmedehabb commented 1 year ago

when #25 get approved, I will pull the new changes and update this pr to solve linter issues.

wrussell1999 commented 1 year ago

Hey @ahmedehabb! #25 is all merged in now, so you're good to now complete the following:

wrussell1999 commented 1 year ago

@ahmedehabb looks all good. Final thing to get it approved would be to update in the README what the purpose of the utils.py so future people know what to put in there!

ahmedehabb commented 1 year ago

sure, i'll do it now.