Fixed test_webui only failing in nix_sandbox
This commit is contained in:
@@ -12,18 +12,18 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ClanDataPath(BaseModel):
|
||||
dest: Path
|
||||
directory: Path
|
||||
|
||||
@validator("dest")
|
||||
def check_data_path(cls: Any, v: Path) -> Path: # noqa
|
||||
@validator("directory")
|
||||
def check_directory(cls: Any, v: Path) -> Path: # noqa
|
||||
return validate_path(clan_data_dir(), v)
|
||||
|
||||
|
||||
class ClanFlakePath(BaseModel):
|
||||
dest: Path
|
||||
flake_name: Path
|
||||
|
||||
@validator("dest")
|
||||
def check_dest(cls: Any, v: Path) -> Path: # noqa
|
||||
@validator("flake_name")
|
||||
def check_flake_name(cls: Any, v: Path) -> Path: # noqa
|
||||
return validate_path(clan_flakes_dir(), v)
|
||||
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ async def inspect_flake(
|
||||
async def create_flake(
|
||||
args: Annotated[FlakeCreateInput, Body()],
|
||||
) -> FlakeCreateResponse:
|
||||
if args.dest.exists():
|
||||
if args.flake_name.exists():
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_409_CONFLICT,
|
||||
detail="Flake already exists",
|
||||
)
|
||||
|
||||
cmd_out = await create.create_flake(args.dest, args.url)
|
||||
cmd_out = await create.create_flake(args.flake_name, args.url)
|
||||
return FlakeCreateResponse(cmd_out=cmd_out)
|
||||
|
||||
Reference in New Issue
Block a user