Punishments from db
This commit is contained in:
parent
18b9c9de55
commit
25df720757
12 changed files with 322 additions and 60 deletions
28
db/models.py
28
db/models.py
|
|
@ -40,6 +40,14 @@ class OrdersPool(BaseModel):
|
|||
time = TextField(null=True)
|
||||
confirm_delay = IntegerField(null=True)
|
||||
|
||||
punishment_pool = ForeignKeyField(
|
||||
'self',
|
||||
column_name='punishment_pool_id',
|
||||
field='id',
|
||||
backref='punishments_for',
|
||||
null=True
|
||||
)
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
|
|
@ -50,6 +58,7 @@ class OrdersPool(BaseModel):
|
|||
'weekends': self.weekends,
|
||||
'time': self.time,
|
||||
'confirm_delay': self.confirm_delay,
|
||||
'punishment_pool_id': self.punishment_pool_id,
|
||||
'orders': [{
|
||||
'id': order.id,
|
||||
'name': order.name,
|
||||
|
|
@ -90,19 +99,10 @@ class OrderAddOn(BaseModel):
|
|||
#
|
||||
# Order State
|
||||
#
|
||||
class PunishmentStatus(BaseModel):
|
||||
confirmed_at = DateTimeField(null=True) # TIMESTAMP
|
||||
created_at = DateTimeField() # TIMESTAMP
|
||||
mastodon_id = TextField()
|
||||
text = TextField()
|
||||
|
||||
class Meta:
|
||||
table_name = 'punishment_status'
|
||||
|
||||
class OrderStatus(BaseModel):
|
||||
confirmed_at = DateTimeField(null=True) # TIMESTAMP
|
||||
created_at = DateTimeField() # TIMESTAMP
|
||||
due_at = DateTimeField() # TIMESTAMP
|
||||
due_at = DateTimeField(null=True) # TIMESTAMP
|
||||
mastodon_id = TextField()
|
||||
text = TextField()
|
||||
|
||||
|
|
@ -122,6 +122,14 @@ class OrderStatus(BaseModel):
|
|||
null=False
|
||||
)
|
||||
|
||||
punishment_for = ForeignKeyField(
|
||||
'self',
|
||||
column_name='punishment_for_id',
|
||||
field='id',
|
||||
backref='punishment',
|
||||
null=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
table_name = 'order_status'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import datetime
|
||||
|
||||
from .models import database, User, OrdersPool, DomSubUsers, Repeat, SkipDay, OrderStatus, PunishmentStatus
|
||||
from .models import database, User, OrdersPool, DomSubUsers, Repeat, SkipDay, OrderStatus
|
||||
|
||||
def initdb():
|
||||
database.connect()
|
||||
database.create_tables([
|
||||
Repeat,
|
||||
SkipDay,
|
||||
OrderStatus,
|
||||
PunishmentStatus
|
||||
OrderStatus
|
||||
])
|
||||
|
||||
def user_add(username, chat_id):
|
||||
|
|
@ -90,24 +89,20 @@ def skip_day_contains(date):
|
|||
q = SkipDay.select().where(SkipDay.date == date)
|
||||
return len(q) > 0
|
||||
|
||||
def order_status_put(orders_pool, user, mastodon_id, created_at, due_at, text):
|
||||
def order_status_put(orders_pool, user, mastodon_id, created_at, due_at, text, punishment_for=None):
|
||||
return OrderStatus.create(
|
||||
orders_pool_id=orders_pool.id,
|
||||
user_id=user.id,
|
||||
mastodon_id=mastodon_id,
|
||||
created_at=created_at,
|
||||
due_at=due_at,
|
||||
text=text
|
||||
text=text,
|
||||
punishment_for=punishment_for
|
||||
)
|
||||
|
||||
def order_status_by_id(order_status_id):
|
||||
return OrderStatus.get(id=order_status_id)
|
||||
|
||||
def order_status_outstanding():
|
||||
return OrderStatus.select().where(
|
||||
(OrderStatus.confirmed_at.is_null()) & (OrderStatus.punishment_id.is_null())
|
||||
)
|
||||
|
||||
def order_status_confirm(id, confirmed_at):
|
||||
q = OrderStatus.update(
|
||||
confirmed_at=confirmed_at
|
||||
|
|
@ -115,17 +110,3 @@ def order_status_confirm(id, confirmed_at):
|
|||
OrderStatus.id == id
|
||||
)
|
||||
return q.execute()
|
||||
|
||||
def punishment_status_put(order_status_id, mastodon_id, created_at, text):
|
||||
punishment_status = PunishmentStatus.create(
|
||||
mastodon_id=mastodon_id,
|
||||
created_at=created_at,
|
||||
text=text
|
||||
)
|
||||
|
||||
q = OrderStatus.update(
|
||||
punishment_id=punishment_status.id
|
||||
).where(
|
||||
OrderStatus.id == order_status_id
|
||||
)
|
||||
q.execute()
|
||||
|
|
|
|||
20
flask/api.py
20
flask/api.py
|
|
@ -152,6 +152,14 @@ def sub_order_set(username, set_id, sub):
|
|||
try:
|
||||
op.name = request.json['name']
|
||||
|
||||
if ('punishment_pool_id' in request.json and
|
||||
request.json['punishment_pool_id'] in [
|
||||
op.id for op in orders_pool_list(sub.id)
|
||||
]):
|
||||
op.punishment_pool_id = request.json['punishment_pool_id']
|
||||
else:
|
||||
op.punishment_pool_id = None
|
||||
|
||||
op.scheduled = request.json['scheduled']
|
||||
if op.scheduled:
|
||||
op.probability = request.json['probability']
|
||||
|
|
@ -198,4 +206,14 @@ def sub_order_set(username, set_id, sub):
|
|||
op.delete_instance(recursive=True)
|
||||
return ('', 204)
|
||||
|
||||
return jsonify(op.to_dict())
|
||||
return jsonify({
|
||||
"orderSets": [
|
||||
{
|
||||
'id': op.id,
|
||||
'name': op.name,
|
||||
}
|
||||
for op
|
||||
in orders_pool_list(sub.id)
|
||||
],
|
||||
"orderSet": op.to_dict()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
Collapse,
|
||||
NumberInput,
|
||||
Text,
|
||||
Select,
|
||||
} from "@mantine/core";
|
||||
import { notifications } from "@mantine/notifications";
|
||||
import { TimeInput } from "@mantine/dates";
|
||||
|
|
@ -68,21 +69,38 @@ type FormOrderSetOrder = Omit<OrderSetOrder, "id" | "add_ons"> & {
|
|||
add_ons: FormOrderSetOrderAddOn[];
|
||||
};
|
||||
|
||||
type FormOrderSet = Omit<OrderSet, "orders"> & {
|
||||
type FormOrderSet = Omit<OrderSet, "orders" | "punishment_pool_id"> & {
|
||||
orders: FormOrderSetOrder[];
|
||||
punishment_pool_id?: string | number;
|
||||
};
|
||||
|
||||
export const OrderSet: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const { username, set_id } = useParams();
|
||||
const orderSet = useLoaderData<OrderSet>();
|
||||
const { orderSets, orderSet } = useLoaderData<{
|
||||
orderSets: Pick<OrderSet, "id" | "name">[];
|
||||
orderSet: OrderSet;
|
||||
}>();
|
||||
const [showScheduling, setShowScheduling] = React.useState(
|
||||
orderSet?.scheduled,
|
||||
);
|
||||
|
||||
const punishmentOptions = React.useMemo(
|
||||
() =>
|
||||
orderSets.map(({ id, name }) => ({ id, value: `${id}`, label: name })),
|
||||
[orderSets],
|
||||
);
|
||||
|
||||
const form = useForm<Partial<FormOrderSet>>({
|
||||
mode: "uncontrolled",
|
||||
initialValues: orderSet ?? {
|
||||
initialValues: orderSet
|
||||
? {
|
||||
...orderSet,
|
||||
punishment_pool_id: orderSet.punishment_pool_id
|
||||
? `${orderSet.punishment_pool_id}`
|
||||
: undefined,
|
||||
}
|
||||
: {
|
||||
scheduled: false,
|
||||
orders: [],
|
||||
},
|
||||
|
|
@ -105,12 +123,22 @@ export const OrderSet: React.FC = () => {
|
|||
value.length < 1 ? "Please enter a name" : null,
|
||||
},
|
||||
},
|
||||
punishment_pool_id: (value: string) =>
|
||||
!value || orderSets.some(({ id }) => id === Number(value))
|
||||
? null
|
||||
: "Please select a valid pool",
|
||||
},
|
||||
onValuesChange: (values) => {
|
||||
if (values.scheduled !== showScheduling) {
|
||||
setShowScheduling(values.scheduled);
|
||||
}
|
||||
},
|
||||
transformValues: (values) => ({
|
||||
...values,
|
||||
punishment_pool_id: values.punishment_pool_id
|
||||
? Number(values.punishment_pool_id)
|
||||
: undefined,
|
||||
}),
|
||||
});
|
||||
|
||||
const handleSubmit = React.useCallback(
|
||||
|
|
@ -235,6 +263,13 @@ export const OrderSet: React.FC = () => {
|
|||
/>
|
||||
</Paper>
|
||||
</Collapse>
|
||||
<Select
|
||||
clearable
|
||||
label="Punishment Pool"
|
||||
description="Orders Pool to issue punishments from"
|
||||
data={punishmentOptions}
|
||||
{...form.getInputProps("punishment_pool_id")}
|
||||
/>
|
||||
|
||||
<Title order={2} mt="lg" mb="sm">
|
||||
Orders
|
||||
|
|
|
|||
1
flask/vite/src/index.d.ts
vendored
1
flask/vite/src/index.d.ts
vendored
|
|
@ -22,4 +22,5 @@ type OrderSet = {
|
|||
weekends: boolean;
|
||||
time: string;
|
||||
confirm_delay: string;
|
||||
punishment_pool_id?: number;
|
||||
}
|
||||
|
|
|
|||
11
generate.py
11
generate.py
|
|
@ -59,9 +59,10 @@ def generate_order(orders_pool):
|
|||
"orders": result
|
||||
}
|
||||
|
||||
def generate_punishment():
|
||||
orders_config = read_config()
|
||||
def generate_punishment(orders_pool):
|
||||
# Pick new orders
|
||||
(result, repeat_p) = pick_order(orders_pool.orders)
|
||||
|
||||
(result, repeat_p) = pick_order(orders_config['punishments'])
|
||||
|
||||
return result
|
||||
return {
|
||||
"orders": result
|
||||
}
|
||||
|
|
|
|||
55
migrations/009_delete_punishment_status.py
Normal file
55
migrations/009_delete_punishment_status.py
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"""Peewee migrations -- 009_delete_punishment_status.py.
|
||||
|
||||
Some examples (model - class or model name)::
|
||||
|
||||
> Model = migrator.orm['table_name'] # Return model in current state by name
|
||||
> Model = migrator.ModelClass # Return model in current state by name
|
||||
|
||||
> migrator.sql(sql) # Run custom SQL
|
||||
> migrator.run(func, *args, **kwargs) # Run python function with the given args
|
||||
> migrator.create_model(Model) # Create a model (could be used as decorator)
|
||||
> migrator.remove_model(model, cascade=True) # Remove a model
|
||||
> migrator.add_fields(model, **fields) # Add fields to a model
|
||||
> migrator.change_fields(model, **fields) # Change fields
|
||||
> migrator.remove_fields(model, *field_names, cascade=True)
|
||||
> migrator.rename_field(model, old_field_name, new_field_name)
|
||||
> migrator.rename_table(model, new_table_name)
|
||||
> migrator.add_index(model, *col_names, unique=False)
|
||||
> migrator.add_not_null(model, *field_names)
|
||||
> migrator.add_default(model, field_name, default)
|
||||
> migrator.add_constraint(model, name, sql)
|
||||
> migrator.drop_index(model, *col_names)
|
||||
> migrator.drop_not_null(model, *field_names)
|
||||
> migrator.drop_constraints(model, *constraints)
|
||||
|
||||
"""
|
||||
|
||||
from contextlib import suppress
|
||||
|
||||
import peewee as pw
|
||||
from peewee_migrate import Migrator
|
||||
|
||||
|
||||
with suppress(ImportError):
|
||||
import playhouse.postgres_ext as pw_pext
|
||||
|
||||
|
||||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your migrations here."""
|
||||
|
||||
migrator.remove_model('punishment_status')
|
||||
|
||||
|
||||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your rollback migrations here."""
|
||||
|
||||
@migrator.create_model
|
||||
class PunishmentStatus(pw.Model):
|
||||
id = pw.AutoField()
|
||||
confirmed_at = pw.DateTimeField(null=True)
|
||||
created_at = pw.DateTimeField()
|
||||
mastodon_id = pw.TextField()
|
||||
text = pw.TextField()
|
||||
|
||||
class Meta:
|
||||
table_name = "punishment_status"
|
||||
51
migrations/010_add_order_status_punishment_for.py
Normal file
51
migrations/010_add_order_status_punishment_for.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Peewee migrations -- 010_add_order_status_punishment_for.py.
|
||||
|
||||
Some examples (model - class or model name)::
|
||||
|
||||
> Model = migrator.orm['table_name'] # Return model in current state by name
|
||||
> Model = migrator.ModelClass # Return model in current state by name
|
||||
|
||||
> migrator.sql(sql) # Run custom SQL
|
||||
> migrator.run(func, *args, **kwargs) # Run python function with the given args
|
||||
> migrator.create_model(Model) # Create a model (could be used as decorator)
|
||||
> migrator.remove_model(model, cascade=True) # Remove a model
|
||||
> migrator.add_fields(model, **fields) # Add fields to a model
|
||||
> migrator.change_fields(model, **fields) # Change fields
|
||||
> migrator.remove_fields(model, *field_names, cascade=True)
|
||||
> migrator.rename_field(model, old_field_name, new_field_name)
|
||||
> migrator.rename_table(model, new_table_name)
|
||||
> migrator.add_index(model, *col_names, unique=False)
|
||||
> migrator.add_not_null(model, *field_names)
|
||||
> migrator.add_default(model, field_name, default)
|
||||
> migrator.add_constraint(model, name, sql)
|
||||
> migrator.drop_index(model, *col_names)
|
||||
> migrator.drop_not_null(model, *field_names)
|
||||
> migrator.drop_constraints(model, *constraints)
|
||||
|
||||
"""
|
||||
|
||||
from contextlib import suppress
|
||||
|
||||
import peewee as pw
|
||||
from peewee_migrate import Migrator
|
||||
|
||||
|
||||
with suppress(ImportError):
|
||||
import playhouse.postgres_ext as pw_pext
|
||||
|
||||
|
||||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your migrations here."""
|
||||
|
||||
migrator.add_fields(
|
||||
'order_status',
|
||||
|
||||
punishment_for=pw.ForeignKeyField(column_name='punishment_for_id', field='id', model='self', null=True))
|
||||
|
||||
|
||||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your rollback migrations here."""
|
||||
|
||||
migrator.remove_fields('order_status', 'punishment_for')
|
||||
|
||||
migrator.drop_index('order_status', 'punishment_for')
|
||||
51
migrations/011_add_orders_pool_punishment_pool.py
Normal file
51
migrations/011_add_orders_pool_punishment_pool.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
"""Peewee migrations -- 011_add_orders_pool_punishment_pool.py.
|
||||
|
||||
Some examples (model - class or model name)::
|
||||
|
||||
> Model = migrator.orm['table_name'] # Return model in current state by name
|
||||
> Model = migrator.ModelClass # Return model in current state by name
|
||||
|
||||
> migrator.sql(sql) # Run custom SQL
|
||||
> migrator.run(func, *args, **kwargs) # Run python function with the given args
|
||||
> migrator.create_model(Model) # Create a model (could be used as decorator)
|
||||
> migrator.remove_model(model, cascade=True) # Remove a model
|
||||
> migrator.add_fields(model, **fields) # Add fields to a model
|
||||
> migrator.change_fields(model, **fields) # Change fields
|
||||
> migrator.remove_fields(model, *field_names, cascade=True)
|
||||
> migrator.rename_field(model, old_field_name, new_field_name)
|
||||
> migrator.rename_table(model, new_table_name)
|
||||
> migrator.add_index(model, *col_names, unique=False)
|
||||
> migrator.add_not_null(model, *field_names)
|
||||
> migrator.add_default(model, field_name, default)
|
||||
> migrator.add_constraint(model, name, sql)
|
||||
> migrator.drop_index(model, *col_names)
|
||||
> migrator.drop_not_null(model, *field_names)
|
||||
> migrator.drop_constraints(model, *constraints)
|
||||
|
||||
"""
|
||||
|
||||
from contextlib import suppress
|
||||
|
||||
import peewee as pw
|
||||
from peewee_migrate import Migrator
|
||||
|
||||
|
||||
with suppress(ImportError):
|
||||
import playhouse.postgres_ext as pw_pext
|
||||
|
||||
|
||||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your migrations here."""
|
||||
|
||||
migrator.add_fields(
|
||||
'orders_pool',
|
||||
|
||||
punishment_pool=pw.ForeignKeyField(column_name='punishment_pool_id', field='id', model='self', null=True))
|
||||
|
||||
|
||||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your rollback migrations here."""
|
||||
|
||||
migrator.remove_fields('orders_pool', 'punishment_pool')
|
||||
|
||||
migrator.drop_index('orders_pool', 'punishment_pool')
|
||||
50
migrations/012_add_order_status_null_due_at.py
Normal file
50
migrations/012_add_order_status_null_due_at.py
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
"""Peewee migrations -- 012_add_order_status_null_due_at.py.
|
||||
|
||||
Some examples (model - class or model name)::
|
||||
|
||||
> Model = migrator.orm['table_name'] # Return model in current state by name
|
||||
> Model = migrator.ModelClass # Return model in current state by name
|
||||
|
||||
> migrator.sql(sql) # Run custom SQL
|
||||
> migrator.run(func, *args, **kwargs) # Run python function with the given args
|
||||
> migrator.create_model(Model) # Create a model (could be used as decorator)
|
||||
> migrator.remove_model(model, cascade=True) # Remove a model
|
||||
> migrator.add_fields(model, **fields) # Add fields to a model
|
||||
> migrator.change_fields(model, **fields) # Change fields
|
||||
> migrator.remove_fields(model, *field_names, cascade=True)
|
||||
> migrator.rename_field(model, old_field_name, new_field_name)
|
||||
> migrator.rename_table(model, new_table_name)
|
||||
> migrator.add_index(model, *col_names, unique=False)
|
||||
> migrator.add_not_null(model, *field_names)
|
||||
> migrator.add_default(model, field_name, default)
|
||||
> migrator.add_constraint(model, name, sql)
|
||||
> migrator.drop_index(model, *col_names)
|
||||
> migrator.drop_not_null(model, *field_names)
|
||||
> migrator.drop_constraints(model, *constraints)
|
||||
|
||||
"""
|
||||
|
||||
from contextlib import suppress
|
||||
|
||||
import peewee as pw
|
||||
from peewee_migrate import Migrator
|
||||
|
||||
|
||||
with suppress(ImportError):
|
||||
import playhouse.postgres_ext as pw_pext
|
||||
|
||||
|
||||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your migrations here."""
|
||||
|
||||
migrator.change_fields('order_status', due_at=pw.DateTimeField(null=True))
|
||||
|
||||
migrator.drop_not_null('order_status', 'due_at')
|
||||
|
||||
|
||||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your rollback migrations here."""
|
||||
|
||||
migrator.change_fields('order_status', due_at=pw.DateTimeField())
|
||||
|
||||
migrator.add_not_null('order_status', 'due_at')
|
||||
37
orders.py
37
orders.py
|
|
@ -4,7 +4,7 @@ import asyncio
|
|||
|
||||
from util import make_session
|
||||
from generate import generate_order, generate_punishment
|
||||
from db.queries import order_status_by_id, order_status_put, punishment_status_put, order_status_outstanding, order_status_confirm
|
||||
from db.queries import order_status_by_id, order_status_put, order_status_confirm
|
||||
from mastodon import Mastodon
|
||||
from telegram.telegram import Telegram
|
||||
from settings import MASTODON_USERNAME, ORDER_TIMEOUT, ENV
|
||||
|
|
@ -91,6 +91,7 @@ async def order_issue(orders_pool):
|
|||
)
|
||||
|
||||
async def punishment_mastodon_post(session, punishment_str, reply_id=None):
|
||||
# TODO: Get user's mastodon username
|
||||
post = "@%s has failed to post proof of compliance. Here is the punishment -\n\n" % MASTODON_USERNAME
|
||||
post += punishment_str + "\n\n"
|
||||
if ENV == 'dev':
|
||||
|
|
@ -104,7 +105,7 @@ async def punishment_mastodon_post(session, punishment_str, reply_id=None):
|
|||
in_reply_to_id=reply_id
|
||||
)
|
||||
|
||||
async def punishment_telegram_post(session, punishment_str, m_url):
|
||||
async def punishment_telegram_post(session, orders_pool, punishment_str, m_url):
|
||||
post = "You failed to show proof of compliance. Here is your punishment -\n\n"
|
||||
post += punishment_str + "\n\n"
|
||||
post += m_url
|
||||
|
|
@ -112,34 +113,40 @@ async def punishment_telegram_post(session, punishment_str, m_url):
|
|||
post += "\n\n⚠️ DEV"
|
||||
|
||||
t = Telegram(session)
|
||||
await t.message_send(post)
|
||||
await t.message_send(orders_pool.user.telegram_chat_id, post)
|
||||
|
||||
async def punishment_issue(session, outstanding_order):
|
||||
# TODO: Generate a punishment
|
||||
|
||||
logger.info('TODO: Generate a punishment')
|
||||
async def punishment_issue(session, order_status):
|
||||
if order_status.pool is None or order_status.pool.punishment_pool is None:
|
||||
logger.info(f'Unable to issue a punishment for {order_status.id}, no punishment pool for order pool {order_status.pool.name}')
|
||||
# TODO: No punishment mastodon/telegram posts
|
||||
return
|
||||
|
||||
punishment = generate_punishment()
|
||||
punishment_str = "\n".join(punishment)
|
||||
punishment_pool = order_status.pool.punishment_pool
|
||||
|
||||
punishment = generate_punishment(punishment_pool)
|
||||
punishment_str = "\n".join(punishment['orders'])
|
||||
|
||||
punishment_status = await punishment_mastodon_post(
|
||||
session,
|
||||
punishment_str,
|
||||
outstanding_order.mastodon_id,
|
||||
order_status.mastodon_id,
|
||||
)
|
||||
|
||||
await punishment_telegram_post(
|
||||
session,
|
||||
punishment_pool,
|
||||
punishment_str,
|
||||
punishment_status['url']
|
||||
)
|
||||
|
||||
punishment_status_put(
|
||||
outstanding_order.id,
|
||||
order_status_put(
|
||||
punishment_pool,
|
||||
order_status.user,
|
||||
punishment_status['id'],
|
||||
punishment_status['created_at'],
|
||||
punishment_str
|
||||
None,
|
||||
punishment_str,
|
||||
punishment_for=order_status
|
||||
)
|
||||
|
||||
order_check_lock = asyncio.Lock()
|
||||
|
|
@ -148,6 +155,10 @@ async def order_check(order_status_id):
|
|||
async with make_session() as session:
|
||||
order_status = order_status_by_id(order_status_id)
|
||||
|
||||
if order_status.punishment.count() > 0:
|
||||
logger.info(f'Punishment already issued for {order_status.id}')
|
||||
return
|
||||
|
||||
m = Mastodon(session)
|
||||
context = await m.statusContext(order_status.mastodon_id)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from scheduler.asyncio import Scheduler
|
|||
|
||||
from settings import TIMEZONE
|
||||
from orders import order_issue, order_check
|
||||
from db.queries import order_status_outstanding, orders_pool_by_id, orders_pool_scheduled, skip_day_contains
|
||||
from db.queries import orders_pool_by_id, orders_pool_scheduled, skip_day_contains
|
||||
from util import order_time
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
Loading…
Reference in a new issue