mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Remove config utils
This commit is contained in:
parent
c67e15c367
commit
f99354ba53
3 changed files with 0 additions and 28 deletions
|
@ -32,7 +32,6 @@ from wtforms.widgets import NumberInput
|
|||
|
||||
from . import adminSpace, app, assistantSpace, db, user_datastore
|
||||
from .advlabdb_independent_funs import flashRandomPassword
|
||||
from .configUtils import getConfig
|
||||
from .customClasses import (
|
||||
CustomIdEndpointLinkRowAction,
|
||||
SecureAdminBaseView,
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
import json
|
||||
|
||||
|
||||
def getConfig(label):
|
||||
with open("config.json", "r") as f:
|
||||
return json.load(f)[label] # TODO: error handling
|
||||
|
||||
|
||||
def setConfig(label, value, new=False):
|
||||
with open("config.json", "r") as f:
|
||||
config = json.load(f)
|
||||
|
||||
if new and (label in config):
|
||||
# Setting is not new! # TODO
|
||||
return False
|
||||
|
||||
if not new and (label not in config):
|
||||
# Tried to update a setting which is new! # TODO
|
||||
return False
|
||||
|
||||
config[label] = value
|
||||
|
||||
with open("config.json", "w") as f:
|
||||
json.dump(config, f)
|
||||
|
||||
return True
|
|
@ -14,7 +14,6 @@ from flask_security.models.fsqla_v2 import FsRoleMixin, FsUserMixin
|
|||
from sqlalchemy import select
|
||||
|
||||
from . import db
|
||||
from .configUtils import getConfig
|
||||
from .exceptions import DataBaseException
|
||||
from .model_independent_funs import get_first
|
||||
|
||||
|
|
Loading…
Reference in a new issue