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
cee9fa5d
Verified
Commit
cee9fa5d
authored
Jun 25, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin: improve add user validation
parent
030064b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
admin.py
src/handlers/admin.py
+7
-2
No files found.
src/handlers/admin.py
View file @
cee9fa5d
...
...
@@ -7,7 +7,7 @@ from data.keyboards import admin_keyboards
from
database.func
import
DB
from
rules
import
BotAdmin
from
config
import
tg_api
,
config
from
config
import
tg_api
,
config
,
DEFAUIL_BRANCHES
dp
=
Dispatch
()
dp
.
message
.
auto_rules
=
BotAdmin
()
...
...
@@ -71,14 +71,19 @@ async def alrtrepo_users(
if
not
branch
:
branch
=
"sisyphus"
if
branch
not
in
DEFAUIL_BRANCHES
:
await
m
.
answer
(
"Репозиторий не найден"
)
return
maintainer_obj
=
DB
.
maintainer
.
get
(
maintainer
)
maintainer_obj
=
DB
.
maintainer
.
get
(
maintainer
.
lower
()
)
if
not
maintainer_obj
:
await
m
.
answer
(
"Сопровождающий не найден"
)
return
if
DB
.
user
.
add
(
user_id
,
maintainer_obj
,
branch
):
await
m
.
answer
(
"Пользователь добавлен"
)
else
:
await
m
.
answer
(
"Пользователь уже существует"
)
@dp.message
(
Command
(
"altrepo_remove_user"
,
Argument
(
"user_id"
)))
...
...
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