class Database_worker() fix
This commit is contained in:
parent
37c0e3d4aa
commit
e79a2db4fb
|
@ -141,6 +141,9 @@ class Database_worker():
|
||||||
|
|
||||||
def get_all_users(self):
|
def get_all_users(self):
|
||||||
if not config.use_database:
|
if not config.use_database:
|
||||||
|
with open("data.json", "r") as data:
|
||||||
|
self._DATA_DIST = json.load(data)
|
||||||
|
data.close()
|
||||||
return self._DATA_DIST['users']
|
return self._DATA_DIST['users']
|
||||||
try:
|
try:
|
||||||
cur = self._CON.cursor()
|
cur = self._CON.cursor()
|
||||||
|
@ -154,6 +157,9 @@ class Database_worker():
|
||||||
|
|
||||||
def get_from_users(self, from_id):
|
def get_from_users(self, from_id):
|
||||||
if not config.use_database:
|
if not config.use_database:
|
||||||
|
with open("data.json", "r") as data:
|
||||||
|
self._DATA_DIST = json.load(data)
|
||||||
|
data.close()
|
||||||
return self._DATA_DIST['users'][str(from_id)]
|
return self._DATA_DIST['users'][str(from_id)]
|
||||||
try:
|
try:
|
||||||
cur = self._CON.cursor()
|
cur = self._CON.cursor()
|
||||||
|
|
Loading…
Reference in New Issue