Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
altlinux-packages-bot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Unitsaev
altlinux-packages-bot
Commits
7a9e8d8b
You need to sign in or sign up before continuing.
Verified
Commit
7a9e8d8b
authored
Nov 04, 2025
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tasks: update tasks command
parent
80856eb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
27 deletions
+15
-27
tasks.py
src/handlers/tasks.py
+15
-27
No files found.
src/handlers/tasks.py
View file @
7a9e8d8b
...
...
@@ -12,7 +12,7 @@ from services.utils import _bold, date_format, int_validator
from
data.keyboards
import
tasks_keyboards
from
config
import
TASK_URL
from
config
import
TASK_URL
,
DEFAUIL_BRANCHES
dp
=
Dispatch
()
...
...
@@ -20,43 +20,31 @@ dp = Dispatch()
@dp.message
(
Command
(
"tasks"
,
Argument
(
"maintainer"
,
optional
=
True
),
Argument
(
"branch"
,
optional
=
True
)))
async
def
tasks_handler
(
m
:
Message
,
user
:
User
|
None
,
maintainer
:
str
|
None
=
None
,
branch
:
str
|
None
=
None
)
->
None
:
if
not
branch
:
if
user
:
branch
=
user
.
default_branch
else
:
branch
=
"sisyphus"
branch
=
branch
or
(
user
.
default_branch
if
user
else
"sisyphus"
)
if
branch
not
in
DEFAUIL_BRANCHES
:
return
await
m
.
answer
(
"Репозиторий не найден."
)
if
maintainer
:
_maintainer
=
maintainer
.
lower
()
maintainer
=
DB
.
maintainer
.
get
(
_maintainer
)
maintainer
=
DB
.
maintainer
.
get
(
maintainer
.
lower
())
if
not
maintainer
:
await
m
.
answer
(
"Сопровождающий не найден."
)
return
return
await
m
.
answer
(
"Сопровождающий не найден."
)
elif
user
:
maintainer
=
user
.
maintainer
else
:
if
user
:
maintainer
=
user
.
maintainer
else
:
return
return
tasks_data
=
await
altrepo
.
api
.
task
.
progress
.
find_tasks
(
input
=
[
f
"@{maintainer.nickname}"
],
branch
=
branch
)
try
:
tasks_data
=
await
altrepo
.
api
.
task
.
progress
.
find_tasks
(
input
=
[
f
"@{maintainer.nickname}"
],
branch
=
branch
)
except
DataNotFoundError
:
await
m
.
answer
(
"Таски не найдены."
)
return
if
not
tasks_data
.
tasks
:
await
m
.
answer
(
"Нет тасков."
)
return
tasks
=
[
task
for
task
in
tasks_data
.
tasks
if
task
.
task_state
not
in
[
"DONE"
]]
return
await
m
.
answer
(
"Таски не найдены."
)
tasks_message
=
await
create_tasks_message
(
tasks
)
tasks
=
[
task
for
task
in
tasks_data
.
tasks
if
task
.
task_state
!=
"DONE"
]
if
not
tasks
:
return
await
m
.
answer
(
"Нет тасков."
)
await
m
.
answer
(
tasks_message
)
await
m
.
answer
(
await
create_tasks_message
(
tasks
)
)
@dp.message
(
Command
(
"task_search"
,
Argument
(
"args"
,
optional
=
True
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment