Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with loading info only popping up with opening url #7

Closed
ire4ever1190 opened this issue Apr 28, 2018 · 3 comments
Closed

Issue with loading info only popping up with opening url #7

ire4ever1190 opened this issue Apr 28, 2018 · 3 comments

Comments

@ire4ever1190
Copy link
Owner

when going the the url for /list I get this error

Traceback (most recent call last):
  File "D:\Software\Python 3\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "D:\Software\Python 3\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "D:\Software\Python 3\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "D:\Software\Python 3\lib\site-packages\flask\_compat.py", line 33, in reraise
    raise value
  File "D:\Software\Python 3\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "D:\Software\Python 3\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "D:/Projects/app4flaskbackend/app4flask.py", line 132, in show_info
    classes.append("<class>" + str(get(today, i, studentnum)) + "</class>")
  File "D:/Projects/app4flaskbackend/app4flask.py", line 121, in get
    parse = jsonstr["class"]
TypeError: 'NoneType' object is not subscriptable

but when I run

show_info(*with args) 

In the script instead of

app.run()

The error doesn't pop up

@John-AZ1
Copy link

jsonstr is not return a dictionary. That’s what subscriptable means. You need to ensure jsonstr is still a soup object.

@ire4ever1190
Copy link
Owner Author

Why does it need to be a soup object? The line of issue should return a json string from the db but instead why run by using the flask decorator it returns none

@ire4ever1190
Copy link
Owner Author

Dont know what caused the issue but I seemed to have fixed it pushing new code now

ire4ever1190 pushed a commit that referenced this issue Apr 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants