Skip to content

Commit

Permalink
Pulled changes and added themes
Browse files Browse the repository at this point in the history
  • Loading branch information
raisachatterjee committed Jul 3, 2023
1 parent 17d1fea commit ba1597a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ def get_graph_response():
) from json_decode_error
try:
years = year_input_manager(json.loads(request.args.get("Year")))
user_theme = None
if request.args.get("user_theme") :
user_theme = json.loads(request.args.get("user_theme"))
except json.decoder.JSONDecodeError as json_decode_error:
raise InvalidParameterException(
"The Year should either be a Number, array of number or a string of tuple"
) from json_decode_error
user_theme = None
if request.args.get("user_theme") :
user_theme = json.loads(request.args.get("user_theme"))
plot = json.loads(request.args.get("plot"))
queryset = Population.query.filter(
Population.year.in_(years), Population.country.in_(countries)
Expand All @@ -150,13 +150,11 @@ def get_graph_response():
def get_stats_response():
if request.method == "GET":
num = json.loads(request.args.get("Number"))
try:
years = year_input_manager(json.loads(request.args.get("Year")))[:1]
user_theme = None
if request.args.get("user_theme") :
print(json.loads(request.args.get("user_theme")))
user_theme = json.loads(request.args.get("user_theme"))
print(user_theme)
user_theme = json.loads(request.args.get("user_theme"))
try:
years = year_input_manager(json.loads(request.args.get("Year")))[:1]
except json.decoder.JSONDecodeError as json_decode_error:
raise InvalidParameterException(
"The Year should either be a Number, array of number or a string of tuple"
Expand Down

0 comments on commit ba1597a

Please sign in to comment.