This commit is contained in:
Michał 2023-04-08 19:38:16 +00:00
parent 359ab66a0a
commit 5cb8c1dd13
3 changed files with 18 additions and 18 deletions

View file

@ -36,7 +36,7 @@ cache = Cache(config={"CACHE_TYPE": "SimpleCache", "CACHE_DEFAULT_TIMEOUT": 300}
compress = Compress() compress = Compress()
def create_app(test_config=None): def create_app(test_config=None): # pylint: disable=R0914
""" """
Create and configure the main app Create and configure the main app
""" """
@ -85,7 +85,7 @@ def create_app(test_config=None):
lib = Bundle( lib = Bundle(
"lib/*.js", filters="jsmin", output="gen/lib.js", depends="lib/*.js" "lib/*.js", filters="jsmin", output="gen/lib.js", depends="lib/*.js"
) )
js = Bundle( scripts = Bundle(
"js/*.js", filters="jsmin", output="gen/index.js", depends="js/*.js" "js/*.js", filters="jsmin", output="gen/index.js", depends="js/*.js"
) )
styles = Bundle( styles = Bundle(
@ -93,7 +93,7 @@ def create_app(test_config=None):
) )
assets.register("lib", lib) assets.register("lib", lib)
assets.register("js", js) assets.register("js", scripts)
assets.register("styles", styles) assets.register("styles", styles)
# Error handlers, if the error is not a HTTP error, return 500 # Error handlers, if the error is not a HTTP error, return 500

View file

@ -44,8 +44,8 @@ class Users(base, UserMixin): # pylint: disable=too-few-public-methods, C0103
email = Column(String, unique=True, nullable=False) email = Column(String, unique=True, nullable=False)
password = Column(String, nullable=False) password = Column(String, nullable=False)
joined_at = Column( joined_at = Column(
DateTime, nullable=False, server_default=func.now() DateTime, nullable=False, server_default=func.now() # pylint: disable=E1102
) # pylint: disable=E1102 )
posts = relationship("Posts", backref="users") posts = relationship("Posts", backref="users")
groups = relationship("Groups", backref="users") groups = relationship("Groups", backref="users")
@ -66,8 +66,8 @@ class Posts(base): # pylint: disable=too-few-public-methods, C0103
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
author_id = Column(Integer, ForeignKey("users.id")) author_id = Column(Integer, ForeignKey("users.id"))
created_at = Column( created_at = Column(
DateTime, nullable=False, server_default=func.now() DateTime, nullable=False, server_default=func.now() # pylint: disable=E1102
) # pylint: disable=E1102 )
filename = Column(String, unique=True, nullable=False) filename = Column(String, unique=True, nullable=False)
mimetype = Column(String, nullable=False) mimetype = Column(String, nullable=False)
exif = Column(PickleType, nullable=False) exif = Column(PickleType, nullable=False)
@ -91,8 +91,8 @@ class Groups(base): # pylint: disable=too-few-public-methods, C0103
description = Column(String, nullable=False) description = Column(String, nullable=False)
author_id = Column(Integer, ForeignKey("users.id")) author_id = Column(Integer, ForeignKey("users.id"))
created_at = Column( created_at = Column(
DateTime, nullable=False, server_default=func.now() DateTime, nullable=False, server_default=func.now() # pylint: disable=E1102
) # pylint: disable=E1102 )
junction = relationship("GroupJunction", backref="groups") junction = relationship("GroupJunction", backref="groups")
@ -107,8 +107,8 @@ class GroupJunction(base): # pylint: disable=too-few-public-methods, C0103
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
date_added = Column( date_added = Column(
DateTime, nullable=False, server_default=func.now() DateTime, nullable=False, server_default=func.now() # pylint: disable=E1102
) # pylint: disable=E1102 )
group_id = Column(Integer, ForeignKey("groups.id")) group_id = Column(Integer, ForeignKey("groups.id"))
post_id = Column(Integer, ForeignKey("posts.id")) post_id = Column(Integer, ForeignKey("posts.id"))
@ -127,8 +127,8 @@ class Logs(base): # pylint: disable=too-few-public-methods, C0103
code = Column(Integer, nullable=False) code = Column(Integer, nullable=False)
note = Column(String, nullable=False) note = Column(String, nullable=False)
created_at = Column( created_at = Column(
DateTime, nullable=False, server_default=func.now() DateTime, nullable=False, server_default=func.now() # pylint: disable=E1102
) # pylint: disable=E1102 )
class Bans(base): # pylint: disable=too-few-public-methods, C0103 class Bans(base): # pylint: disable=too-few-public-methods, C0103
@ -143,8 +143,8 @@ class Bans(base): # pylint: disable=too-few-public-methods, C0103
code = Column(Integer, nullable=False) code = Column(Integer, nullable=False)
note = Column(String, nullable=False) note = Column(String, nullable=False)
banned_at = Column( banned_at = Column(
DateTime, nullable=False, server_default=func.now() DateTime, nullable=False, server_default=func.now() # pylint: disable=E1102
) # pylint: disable=E1102 )
# check if database file exists, if not create it # check if database file exists, if not create it

View file

@ -68,17 +68,17 @@ class Metadata:
} }
# Thanks chatGPT xP # Thanks chatGPT xP
# the helper function works, so not sure why it triggers pylint
for key, value in encoded_exif.items(): for key, value in encoded_exif.items():
for mapping_name, mapping_val in EXIF_MAPPING: for mapping_name, mapping_val in EXIF_MAPPING:
if key in mapping_val: if key in mapping_val:
if len(mapping_val[key]) == 2: if len(mapping_val[key]) == 2:
# the helper function works, so not sure why it triggers pylint
exif[mapping_name][mapping_val[key][0]] = { exif[mapping_name][mapping_val[key][0]] = {
"raw": value, "raw": value,
"formatted": ( "formatted": (
getattr( getattr(
helpers, mapping_val[key][1] helpers, mapping_val[key][1] # pylint: disable=E0602
)( # pylint: disable=E0602 )(
value value
) )
), ),