Use proper SQL concatenation
This commit is contained in:
@@ -9,6 +9,7 @@ from peewee import (
|
||||
CharField,
|
||||
DateTimeField,
|
||||
DoesNotExist,
|
||||
fn,
|
||||
ForeignKeyField,
|
||||
IntegerField,
|
||||
Model,
|
||||
@@ -297,7 +298,7 @@ def get_hostname_for_user(hostname: str, user: User):
|
||||
Raises:
|
||||
DoesNotExist: If hostname not found or not owned by user.
|
||||
"""
|
||||
fqdn = Hostname.hostname + '.' + Hostname.zone
|
||||
fqdn = fn.Concat(Hostname.hostname, '.', Hostname.zone)
|
||||
return Hostname.get((fqdn == hostname) & (Hostname.user == user))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user