yoheinakajima / instagraph

Converts text input or URL into knowledge graph and displays
MIT License
3.27k stars 281 forks source link

[BUG] NameError: name 'user_plan' is not defined #43

Closed gkorland closed 10 months ago

gkorland commented 11 months ago

Describe the bug I'm getting the following error when trying to open the link

$ python3 main.py
 * Serving Flask app 'main'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:8080
 * Running on http://192.168.1.132:8080
Press CTRL+C to quit
[2023-09-22 03:59:57,400] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1487, in full_dispatch_request
    return self.finalize_request(rv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1508, in finalize_request
    response = self.process_response(response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2002, in process_response
    response = self.ensure_sync(func)(response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/workspace/instagraph/main.py", line 66, in add_header
    if check_if_free_plan():
       ^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/workspace/instagraph/main.py", line 61, in check_if_free_plan
    return user_plan == 'free'
           ^^^^^^^^^
NameError: name 'user_plan' is not defined
[2023-09-22 03:59:57,400] ERROR in app: Request finalizing failed with an error while handling an error
Traceback (most recent call last):
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1487, in full_dispatch_request
    return self.finalize_request(rv)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1508, in finalize_request
    response = self.process_response(response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2002, in process_response
    response = self.ensure_sync(func)(response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/workspace/instagraph/main.py", line 66, in add_header
    if check_if_free_plan():
       ^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/workspace/instagraph/main.py", line 61, in check_if_free_plan
    return user_plan == 'free'
           ^^^^^^^^^
NameError: name 'user_plan' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1508, in finalize_request
    response = self.process_response(response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2002, in process_response
    response = self.ensure_sync(func)(response)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/workspace/instagraph/main.py", line 66, in add_header
    if check_if_free_plan():
       ^^^^^^^^^^^^^^^^^^^^
  File "/home/guy/workspace/instagraph/main.py", line 61, in check_if_free_plan
    return user_plan == 'free'
           ^^^^^^^^^
NameError: name 'user_plan' is not defined
127.0.0.1 - - [22/Sep/2023 03:59:57] "GET / HTTP/1.1" 500 -

To Reproduce Steps to reproduce the behavior:

  1. Run python3 main.py
  2. Click on one of the links

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

panckreous commented 11 months ago

samesies. macos

jrdevore commented 11 months ago

Same issue on windows.

You can define user_plan = "free" in main.py for now I suppose

isamu commented 10 months ago

This has been fixed in the latest version. This ticket will be closed. Thanks.