lint: reformat python code with black
This commit is contained in:
parent
331beb01b4
commit
a406a7974b
88 changed files with 2579 additions and 1608 deletions
|
@ -9,18 +9,18 @@ from app.models.mirrors import StaticOrigin
|
|||
|
||||
|
||||
def create_static_origin(
|
||||
description: str,
|
||||
group_id: int,
|
||||
storage_cloud_account_id: int,
|
||||
source_cloud_account_id: int,
|
||||
source_project: str,
|
||||
auto_rotate: bool,
|
||||
matrix_homeserver: Optional[str],
|
||||
keanu_convene_path: Optional[str],
|
||||
keanu_convene_logo: Optional[FileStorage],
|
||||
keanu_convene_color: Optional[str],
|
||||
clean_insights_backend: Optional[Union[str, bool]],
|
||||
db_session_commit: bool = False,
|
||||
description: str,
|
||||
group_id: int,
|
||||
storage_cloud_account_id: int,
|
||||
source_cloud_account_id: int,
|
||||
source_project: str,
|
||||
auto_rotate: bool,
|
||||
matrix_homeserver: Optional[str],
|
||||
keanu_convene_path: Optional[str],
|
||||
keanu_convene_logo: Optional[FileStorage],
|
||||
keanu_convene_color: Optional[str],
|
||||
clean_insights_backend: Optional[Union[str, bool]],
|
||||
db_session_commit: bool = False,
|
||||
) -> StaticOrigin:
|
||||
"""
|
||||
Create a new static origin.
|
||||
|
@ -47,14 +47,18 @@ def create_static_origin(
|
|||
else:
|
||||
raise ValueError("group_id must be an int")
|
||||
if isinstance(storage_cloud_account_id, int):
|
||||
cloud_account = CloudAccount.query.filter(CloudAccount.id == storage_cloud_account_id).first()
|
||||
cloud_account = CloudAccount.query.filter(
|
||||
CloudAccount.id == storage_cloud_account_id
|
||||
).first()
|
||||
if cloud_account is None:
|
||||
raise ValueError("storage_cloud_account_id must match an existing provider")
|
||||
static_origin.storage_cloud_account_id = storage_cloud_account_id
|
||||
else:
|
||||
raise ValueError("storage_cloud_account_id must be an int")
|
||||
if isinstance(source_cloud_account_id, int):
|
||||
cloud_account = CloudAccount.query.filter(CloudAccount.id == source_cloud_account_id).first()
|
||||
cloud_account = CloudAccount.query.filter(
|
||||
CloudAccount.id == source_cloud_account_id
|
||||
).first()
|
||||
if cloud_account is None:
|
||||
raise ValueError("source_cloud_account_id must match an existing provider")
|
||||
static_origin.source_cloud_account_id = source_cloud_account_id
|
||||
|
@ -69,7 +73,7 @@ def create_static_origin(
|
|||
keanu_convene_logo,
|
||||
keanu_convene_color,
|
||||
clean_insights_backend,
|
||||
False
|
||||
False,
|
||||
)
|
||||
if db_session_commit:
|
||||
db.session.add(static_origin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue