Fix source actions and toggle regressions
This commit is contained in:
parent
94717b1d1b
commit
2a99edeec3
5 changed files with 122 additions and 5 deletions
|
|
@ -305,6 +305,15 @@ def delete_job_source(job_id: int) -> bool:
|
|||
return source.delete_instance() > 0
|
||||
|
||||
|
||||
def delete_source(slug: str) -> bool:
|
||||
with database.connection_context():
|
||||
with database.atomic():
|
||||
source = Source.get_or_none(Source.slug == slug)
|
||||
if source is None:
|
||||
return False
|
||||
return source.delete_instance() > 0
|
||||
|
||||
|
||||
def load_sources() -> tuple[dict[str, object], ...]:
|
||||
with database.connection_context():
|
||||
sources = tuple(Source.select().order_by(Source.created_at.desc()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue