mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Small bugfixes
This commit is contained in:
parent
5f60c2eb17
commit
30838a6402
2 changed files with 7 additions and 3 deletions
|
@ -14,3 +14,4 @@ pygments
|
|||
markovify
|
||||
praw
|
||||
dice
|
||||
raven[flask]
|
|
@ -8,8 +8,8 @@ import datetime
|
|||
import telegram
|
||||
import query_discord_music
|
||||
import random
|
||||
import difflib
|
||||
import re
|
||||
from raven.contrib.flask import Sentry
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
@ -23,6 +23,8 @@ app.secret_key = config["Flask"]["secret_key"]
|
|||
|
||||
telegram_bot = telegram.Bot(config["Telegram"]["bot_token"])
|
||||
|
||||
sentry = Sentry(app, dsn=config["Sentry"]["token"])
|
||||
|
||||
|
||||
@app.errorhandler(400)
|
||||
def error_400(_=None):
|
||||
|
@ -158,7 +160,7 @@ def page_password():
|
|||
def page_editprofile():
|
||||
user_id = fl_session.get("user_id")
|
||||
db_session = db.Session()
|
||||
profile_data = db_session.query(db.ProfileData).filter_by(royal_id=user_id).one_or_none()
|
||||
profile_data = db_session.query(db.ProfileData).filter_by(royal_id=user_id).join(db.Royal).one_or_none()
|
||||
if request.method == "GET":
|
||||
db_session.close()
|
||||
if user_id is None:
|
||||
|
@ -175,6 +177,7 @@ def page_editprofile():
|
|||
if profile_data is None:
|
||||
profile_data = db.ProfileData(royal_id=user_id, css=css, bio=bio)
|
||||
db_session.add(profile_data)
|
||||
db_session.flush()
|
||||
profile_data.royal.fiorygi += 1
|
||||
try:
|
||||
telegram_bot.send_message(config["Telegram"]["main_group"],
|
||||
|
|
Loading…
Reference in a new issue