MCPcopy Create free account
hub / github.com/hunvreus/devpush / async_validate_name

Method async_validate_name

app/forms/project.py:491–506  ·  view source on GitHub ↗
(self, field)

Source from the content-addressed store, hash-verified

489 self.project = project
490
491 async def async_validate_name(self, field):
492 if self.db and self.team and self.project:
493 if self.project.name != field.data:
494 result = await self.db.execute(
495 select(Project).where(
496 func.lower(Project.name) == field.data.lower(),
497 Project.team_id == self.team.id,
498 Project.id != self.project.id,
499 )
500 )
501 if result.scalar_one_or_none():
502 raise ValidationError(
503 _(
504 "A project with this name already exists in this team or is reserved."
505 )
506 )
507
508
509class ProjectCreateForm(StarletteForm):

Callers

nothing calls this directly

Calls 1

_Function · 0.50

Tested by

no test coverage detected