From f8a9dd451b525b8e598511d36c2c9a6c877fce26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sun, 9 Mar 2025 00:17:22 +0100 Subject: [PATCH] fixy z listy todo --- app.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app.py b/app.py index 8ec39fb..ab47d7f 100644 --- a/app.py +++ b/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())