Skip to content

Commit

Permalink
Fixed load_user when user.faction_id == null
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <>
  • Loading branch information
tiksan committed Nov 19, 2023
1 parent e92bd1a commit 96f9b42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import flask
from flask_cors import CORS
from flask_login import LoginManager, current_user
from peewee import DoesNotExist
from peewee import DoesNotExist, JOIN
from tornium_commons import Config, rds
from tornium_commons.formatters import commas, rel_time, torn_timestamp
from tornium_commons.models import Faction
Expand Down Expand Up @@ -141,7 +141,7 @@ def init__app():
def load_user(user_id):
from models.user import AuthUser

return AuthUser.select().join(Faction).where(AuthUser.tid == user_id).first()
return AuthUser.select().join(Faction, JOIN.LEFT_OUTER).where(AuthUser.tid == user_id).first()


@login_manager.unauthorized_handler
Expand Down
2 changes: 1 addition & 1 deletion controllers/authroutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def login(*args, **kwargs):
If this was not you, please contact the developer as soon as possible. You may need to reset your API key to secure your account.
WARNI NG: If the developer is accessing your Tornium account, they will contact you ahead of time through the linked Discord account."""
WARNING: If the developer is accessing your Tornium account, they will contact you ahead of time through the linked Discord account."""
),
"color": SKYNET_INFO,
}
Expand Down

0 comments on commit 96f9b42

Please sign in to comment.