Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arihant2math committed Nov 26, 2023
1 parent 092663f commit 0d8717f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions website/bp/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(self, token, id, active):
a = Agent(AutoTradersSession(token.token))
a.active = token.active
a.id = token.id
a.token = token.token
tokens.append(a)
except Exception as e:
tokens.append(MockAgent(token.token, token.id, token.active))
Expand Down
6 changes: 4 additions & 2 deletions website/bp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from flask import *

from website.model import db, User, Automation, Token
from website.session import get_session, anonymous_session
from website.session import get_session, anonymous_session, get_user
from website.wrappers import token_required, minify_html

main_bp = Blueprint("main", __name__)
Expand Down Expand Up @@ -40,8 +40,10 @@ def rich_format(s):
@minify_html
def settings():
db.create_all()
# token = db.session.query(Token).filter_by().first() # TODO: Filter by user id
user = get_user()
token = None
if user is not None:
token = db.session.query(Token).filter_by(user=user.id).first() # TODO: Filter by user id
status = autotraders.get_status()
server_announcements = status.announcements
announcements = []
Expand Down

0 comments on commit 0d8717f

Please sign in to comment.