mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
chore(lint): reformatting after black update
Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
parent
2373bdf400
commit
f9a5188fb7
8 changed files with 3 additions and 19 deletions
|
@ -75,7 +75,6 @@ cred_filters = {
|
|||
|
||||
|
||||
def has_credential(user: User, credential: int, approved: list = tuple()):
|
||||
|
||||
if user in approved:
|
||||
return True
|
||||
return user.AccountTypeID in cred_filters[credential]
|
||||
|
|
|
@ -470,7 +470,6 @@ async def packages_post(
|
|||
action: str = Form(default=str()),
|
||||
confirm: bool = Form(default=False),
|
||||
):
|
||||
|
||||
# If an invalid action is specified, just render GET /packages
|
||||
# with an BAD_REQUEST status_code.
|
||||
if action not in PACKAGE_ACTIONS:
|
||||
|
|
|
@ -115,7 +115,6 @@ async def requests(
|
|||
@router.get("/requests/{id}/close")
|
||||
@requires_auth
|
||||
async def request_close(request: Request, id: int):
|
||||
|
||||
pkgreq = get_pkgreq_by_id(id)
|
||||
if not request.user.is_elevated() and request.user != pkgreq.User:
|
||||
# Request user doesn't have permission here: redirect to '/'.
|
||||
|
|
|
@ -96,7 +96,6 @@ async def rpc_request(
|
|||
args: Optional[list[str]] = [],
|
||||
callback: Optional[str] = None,
|
||||
):
|
||||
|
||||
# Create a handle to our RPC class.
|
||||
rpc = RPC(version=v, type=type)
|
||||
|
||||
|
|
|
@ -131,7 +131,6 @@ class Notification:
|
|||
|
||||
class ResetKeyNotification(Notification):
|
||||
def __init__(self, uid):
|
||||
|
||||
user = (
|
||||
db.query(User)
|
||||
.filter(and_(User.ID == uid, User.Suspended == 0))
|
||||
|
@ -194,7 +193,6 @@ class WelcomeNotification(ResetKeyNotification):
|
|||
|
||||
class CommentNotification(Notification):
|
||||
def __init__(self, uid, pkgbase_id, comment_id):
|
||||
|
||||
self._user = db.query(User.Username).filter(User.ID == uid).first().Username
|
||||
self._pkgbase = (
|
||||
db.query(PackageBase.Name).filter(PackageBase.ID == pkgbase_id).first().Name
|
||||
|
@ -260,7 +258,6 @@ class CommentNotification(Notification):
|
|||
|
||||
class UpdateNotification(Notification):
|
||||
def __init__(self, uid, pkgbase_id):
|
||||
|
||||
self._user = db.query(User.Username).filter(User.ID == uid).first().Username
|
||||
self._pkgbase = (
|
||||
db.query(PackageBase.Name).filter(PackageBase.ID == pkgbase_id).first().Name
|
||||
|
@ -319,7 +316,6 @@ class UpdateNotification(Notification):
|
|||
|
||||
class FlagNotification(Notification):
|
||||
def __init__(self, uid, pkgbase_id):
|
||||
|
||||
self._user = db.query(User.Username).filter(User.ID == uid).first().Username
|
||||
self._pkgbase = (
|
||||
db.query(PackageBase.Name).filter(PackageBase.ID == pkgbase_id).first().Name
|
||||
|
@ -375,7 +371,6 @@ class FlagNotification(Notification):
|
|||
|
||||
class OwnershipEventNotification(Notification):
|
||||
def __init__(self, uid, pkgbase_id):
|
||||
|
||||
self._user = db.query(User.Username).filter(User.ID == uid).first().Username
|
||||
self._pkgbase = (
|
||||
db.query(PackageBase.Name).filter(PackageBase.ID == pkgbase_id).first().Name
|
||||
|
@ -437,7 +432,6 @@ class DisownNotification(OwnershipEventNotification):
|
|||
|
||||
class ComaintainershipEventNotification(Notification):
|
||||
def __init__(self, uid, pkgbase_id):
|
||||
|
||||
self._pkgbase = (
|
||||
db.query(PackageBase.Name).filter(PackageBase.ID == pkgbase_id).first().Name
|
||||
)
|
||||
|
@ -482,7 +476,6 @@ class ComaintainerRemoveNotification(ComaintainershipEventNotification):
|
|||
|
||||
class DeleteNotification(Notification):
|
||||
def __init__(self, uid, old_pkgbase_id, new_pkgbase_id=None):
|
||||
|
||||
self._user = db.query(User.Username).filter(User.ID == uid).first().Username
|
||||
self._old_pkgbase = (
|
||||
db.query(PackageBase.Name)
|
||||
|
@ -560,7 +553,6 @@ class DeleteNotification(Notification):
|
|||
|
||||
class RequestOpenNotification(Notification):
|
||||
def __init__(self, uid, reqid, reqtype, pkgbase_id, merge_into=None):
|
||||
|
||||
self._user = db.query(User.Username).filter(User.ID == uid).first().Username
|
||||
self._pkgbase = (
|
||||
db.query(PackageBase.Name).filter(PackageBase.ID == pkgbase_id).first().Name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue