Reformatting everything with black

This commit is contained in:
Ian Roddis committed 2026-07-14 14:36:49 -03:00
1 parent 7bd07f084a
commit 8185f1f8b3
48 files changed
+1000 -348

No files matched your search

+25 -3
View File
@@ -77,7 +77,22 @@ PERMISSIONS = [
# Default roles -> permission names. "admin" gets everything.
ROLES = {
"admin": [name for name, _ in PERMISSIONS], # includes audit_log:read
"user": ["users:read", "iso_threads:read", "unc_threads:read", "manufacturers:read", "scope_models:read", "part_colours:read", "part_types:read", "sub_part_types:read", "imported_parts:read", "static_connections:read", "clamp_connections:read", "attachment_point_names:read", "attachment_points:read", "augmented_parts:read"],
"user": [
"users:read",
"iso_threads:read",
"unc_threads:read",
"manufacturers:read",
"scope_models:read",
"part_colours:read",
"part_types:read",
"sub_part_types:read",
"imported_parts:read",
"static_connections:read",
"clamp_connections:read",
"attachment_point_names:read",
"attachment_points:read",
"augmented_parts:read",
],
}
@@ -123,8 +138,15 @@ async def seed() -> None:
pt = await part_type_crud.get_by_name(db, pt_name)
if pt is not None:
for spt_name in spt_names:
if await sub_part_type_crud.get_by_name_and_part_type(db, spt_name, pt.id) is None:
await sub_part_type_crud.create(db, name=spt_name, part_type_id=pt.id)
if (
await sub_part_type_crud.get_by_name_and_part_type(
db, spt_name, pt.id
)
is None
):
await sub_part_type_crud.create(
db, name=spt_name, part_type_id=pt.id
)
# Superuser
existing = await user_crud.get_by_email(db, settings.first_superuser_email)