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

Method async_validate_hostname

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

Source from the content-addressed store, hash-verified

332 ]
333
334 async def async_validate_hostname(self, field):
335 if field.data:
336 query = select(Domain).where(
337 func.lower(Domain.hostname) == field.data.lower()
338 )
339 if self.domain_id.data:
340 query = query.where(Domain.id != int(self.domain_id.data))
341 result = await self.db.execute(query)
342 domain = result.scalar_one_or_none()
343 if domain:
344 raise ValidationError(_("This domain is already in use."))
345
346 def validate_environment_id(self, field):
347 if self.type.data == "route" and not field.data:

Callers

nothing calls this directly

Calls 1

_Function · 0.50

Tested by

no test coverage detected