forked from rDrama/rDrama
same as last commit + remove now-unnecessary scoped_session imports
parent
9b0dc1f44e
commit
cce4f2346c
|
@ -78,7 +78,7 @@ engine = create_engine(app.config['SQLALCHEMY_DATABASE_URL'])
|
|||
|
||||
db_session = scoped_session(sessionmaker(bind=engine))
|
||||
|
||||
const_initialize(db_session)
|
||||
const_initialize(db_session())
|
||||
|
||||
reload_settings()
|
||||
start_watching_settings()
|
||||
|
|
|
@ -2,7 +2,7 @@ import time
|
|||
|
||||
from flask import g
|
||||
from sqlalchemy import Column, ForeignKey
|
||||
from sqlalchemy.orm import relationship, scoped_session
|
||||
from sqlalchemy.orm import relationship, load_only
|
||||
from sqlalchemy.sql.sqltypes import *
|
||||
|
||||
from files.classes import Base
|
||||
|
|
|
@ -6,7 +6,7 @@ from flask import g
|
|||
|
||||
from sqlalchemy import Column, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import TSVECTOR
|
||||
from sqlalchemy.orm import relationship, scoped_session
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.schema import FetchedValue
|
||||
from sqlalchemy.sql.sqltypes import *
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import time
|
||||
|
||||
from sqlalchemy import Column, ForeignKey
|
||||
from sqlalchemy.orm import relationship, scoped_session
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.sql.sqltypes import *
|
||||
from flask import g
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from typing import Any, Callable, Optional, Tuple, Union
|
||||
|
||||
from sqlalchemy import Column, func
|
||||
from sqlalchemy.orm import scoped_session
|
||||
from flask import g
|
||||
|
||||
from files.helpers.config.const import *
|
||||
|
|
|
@ -6,7 +6,7 @@ from flask import g
|
|||
|
||||
from sqlalchemy import Column, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import TSVECTOR
|
||||
from sqlalchemy.orm import relationship, scoped_session
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.schema import FetchedValue
|
||||
from sqlalchemy.sql.sqltypes import *
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from urllib.parse import urlparse
|
|||
from flask import g
|
||||
|
||||
from sqlalchemy import Column, FetchedValue, ForeignKey
|
||||
from sqlalchemy.orm import deferred, relationship, scoped_session
|
||||
from sqlalchemy.orm import deferred, relationship
|
||||
from sqlalchemy.sql.sqltypes import *
|
||||
|
||||
from files.classes import Base
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
from os import path
|
||||
|
||||
from sqlalchemy.orm import scoped_session
|
||||
|
||||
from files.classes import Emoji, Sub
|
||||
from files.helpers.config.const import *
|
||||
|
||||
|
@ -13,7 +11,7 @@ SNAPPY_MARSEYS = []
|
|||
SNAPPY_QUOTES = []
|
||||
STEALTH_HOLES = []
|
||||
|
||||
def const_initialize(db:scoped_session):
|
||||
def const_initialize(db):
|
||||
global marseys_const, marseys_const2, marsey_mappings, SNAPPY_KONGS, SNAPPY_MARSEYS, SNAPPY_QUOTES, STEALTH_HOLES
|
||||
|
||||
marseys_const = [x[0] for x in db.query(Emoji.name).filter(Emoji.kind=="Marsey", Emoji.submitter_id==None, Emoji.name!='chudsey').all()]
|
||||
|
|
Loading…
Reference in New Issue