fixy z listy todo
This commit is contained in:
parent
02088c1782
commit
f8a9dd451b
13
app.py
13
app.py
@ -28,6 +28,7 @@ class User(db.Model):
|
||||
hosts = db.relationship('Host', backref='user', lazy=True)
|
||||
hostfiles = db.relationship('HostFile', backref='user', lazy=True)
|
||||
settings = db.relationship('UserSettings', backref='user', uselist=False)
|
||||
|
||||
class Host(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
hostname = db.Column(db.String(255), nullable=False)
|
||||
@ -55,18 +56,6 @@ class Host(db.Model):
|
||||
except Exception:
|
||||
return self.hostname
|
||||
|
||||
|
||||
def resolved_daemon(self):
|
||||
if self.use_daemon and self.daemon_url:
|
||||
try:
|
||||
daemon_str = self.daemon_url.split("://")[-1]
|
||||
daemon_ip = daemon_str.split(":")[0]
|
||||
return socket.gethostbyaddr(daemon_ip)[0]
|
||||
except Exception:
|
||||
return daemon_ip
|
||||
return self.resolved_hostname
|
||||
|
||||
|
||||
class DeployLog(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
timestamp = db.Column(db.DateTime, default=db.func.current_timestamp())
|
||||
|
Loading…
x
Reference in New Issue
Block a user