mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-03 03:00:22 -04:00
Frontend Update
This commit is contained in:
@@ -166,6 +166,11 @@ class Reminder:
|
||||
).fetchone()
|
||||
reminder = dict(reminder)
|
||||
|
||||
reminder["weekdays"] = [
|
||||
int(n)
|
||||
for n in reminder["weekdays"].split(",")
|
||||
if n
|
||||
] if reminder["weekdays"] else None
|
||||
reminder['notification_services'] = self._get_notification_services()
|
||||
|
||||
return reminder
|
||||
@@ -277,7 +282,7 @@ class Reminder:
|
||||
if repeated_reminder:
|
||||
next_time = _find_next_time(
|
||||
data["time"],
|
||||
RepeatQuantity(data["repeat_quantity"]),
|
||||
RepeatQuantity(data["repeat_quantity"]) if data["repeat_quantity"] else None,
|
||||
data["repeat_interval"],
|
||||
weekdays
|
||||
)
|
||||
@@ -408,6 +413,12 @@ class Reminders:
|
||||
(self.user_id,)
|
||||
)
|
||||
]
|
||||
for r in reminders:
|
||||
r["weekdays"] = [
|
||||
int(n)
|
||||
for n in r["weekdays"].split(",")
|
||||
if n
|
||||
] if r["weekdays"] else None
|
||||
|
||||
# Sort result
|
||||
reminders.sort(key=sort_by.value[0], reverse=sort_by.value[1])
|
||||
|
||||
@@ -23,7 +23,7 @@ class User:
|
||||
|
||||
def __init__(self, id: int) -> None:
|
||||
result = get_db(dict).execute(
|
||||
"SELECT username, admin FROM users WHERE id = ? LIMIT 1;",
|
||||
"SELECT username, admin, salt FROM users WHERE id = ? LIMIT 1;",
|
||||
(id,)
|
||||
).fetchone()
|
||||
if not result:
|
||||
@@ -32,6 +32,7 @@ class User:
|
||||
self.username: str = result['username']
|
||||
self.user_id = id
|
||||
self.admin: bool = result['admin'] == 1
|
||||
self.salt: bytes = result['salt']
|
||||
return
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user