Skip to content

Commit

Permalink
Added type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgtzg committed Feb 3, 2025
1 parent 82dfb1a commit aad7395
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from flask import Flask, jsonify, request
from models import Experience, Education, Skill
from gpt_connection import get_improvement
from spell_check import spell_check_json
from spell_check import spell_check
app = Flask(__name__)

data = {
Expand Down Expand Up @@ -51,8 +51,8 @@ def experience():

if request.method == 'POST':
json_data = request.json
if json_data['spell_check']:
json_data = spell_check_json(json_data)
if json_data.get('spell_check') and isinstance(json_data.get('description'), str):
json_data['description'] = spell_check(json_data['description'])

return jsonify(json_data)

Expand All @@ -68,9 +68,8 @@ def education():

if request.method == 'POST':
json_data = request.json
if json_data['spell_check']:
json_data = spell_check_json(json_data)

if json_data.get('spell_check') and isinstance(json_data.get('description'), str):
json_data['description'] = spell_check(json_data['description'])
return jsonify(json_data)

return jsonify({})
Expand Down Expand Up @@ -103,8 +102,8 @@ def skill():

if request.method == 'POST':
json_data = request.json
if json_data['spell_check']:
json_data = spell_check_json(json_data)
if json_data.get('spell_check') and isinstance(json_data.get('description'), str):
json_data['description'] = spell_check(json_data['description'])

return jsonify(json_data)

Expand Down

0 comments on commit aad7395

Please sign in to comment.