diff --git a/backend/areas/apps/models.py b/backend/areas/apps/models.py index 88930330bd7289a552ecfa29136431b674f4dd6e..cf8d7153f1d34ed9b823f374f45dd570f22560d8 100644 --- a/backend/areas/apps/models.py +++ b/backend/areas/apps/models.py @@ -41,7 +41,7 @@ class App(db.Model): self.external = external self.url = url - def __repr__(self): + def __str__(self): return f"{self.id} <{self.name}>" def get_url(self): @@ -228,7 +228,7 @@ class AppRole(db.Model): # pylint: disable=too-few-public-methods role = relationship("Role") app = relationship("App") - def __repr__(self): + def __str__(self): return (f"role_id: {self.role_id}, user_id: {self.user_id}," f" app_id: {self.app_id}, role: {self.role}") @@ -287,7 +287,7 @@ class AppStatus(): # pylint: disable=too-few-public-methods self.ready = ks_ready self.message = f"App Kustomization status: {ks_message}" - def __repr__(self): + def __str__(self): return f"Installed: {self.installed}\tReady: {self.ready}\tMessage: {self.message}" def to_dict(self): @@ -313,7 +313,7 @@ class OAuthClientApp(db.Model): # pylint: disable=too-few-public-methods app = relationship("App", back_populates="oauthclients") - def __repr__(self): + def __str__(self): return (f"oauthclient_id: {self.oauthclient_id}, app_id: {self.app_id}," f" app: {self.app}") @@ -327,6 +327,6 @@ class ScimAttribute(db.Model): # pylint: disable=too-few-public-methods app_id = db.Column(Integer, ForeignKey("app.id"), primary_key=True) attribute = db.Column(String(length=64), primary_key=True) - def __repr__(self): + def __str__(self): return (f"attribute: {self.attribute}, user_id: {self.user_id}," f" app_id: {self.app_id}") diff --git a/backend/areas/roles/models.py b/backend/areas/roles/models.py index b761bb579ebc9133b86c8822c724f1eda2112a97..49eb092323bb41227d3be93a28cc536f192d173b 100644 --- a/backend/areas/roles/models.py +++ b/backend/areas/roles/models.py @@ -9,5 +9,5 @@ class Role(db.Model): id = db.Column(Integer, primary_key=True) name = db.Column(String(length=64)) - def __repr__(self): + def __str__(self): return f"Role {self.name}" diff --git a/backend/areas/tags/models.py b/backend/areas/tags/models.py index 216d24550ee7935e2eebfe3062f981f1df7dfcd9..f27069aeb5863c4c8a0c42f2c50be812d6d53668 100644 --- a/backend/areas/tags/models.py +++ b/backend/areas/tags/models.py @@ -6,7 +6,7 @@ class Tag(db.Model): name = db.Column(String(length=256)) colour = db.Column(String(length=64)) - def __repr__(self): + def __str__(self): return f"Tag {self.slug}" class TagUser(db.Model): @@ -14,5 +14,5 @@ class TagUser(db.Model): user_id = db.Column(String(length=64), primary_key=True) tag_id = db.Column(Integer, primary_key=True) - def __repr__(self): + def __str__(self): return f"TagUser, with tag_id {self.tag_id}, user_id {self.user_id}" diff --git a/backend/helpers/kratos_user.py b/backend/helpers/kratos_user.py index 242d8790ca17ced55cdd41fef6411a1f203a43b0..a71ef7213432adc1905b1e898aacc0d45a1b9d1c 100644 --- a/backend/helpers/kratos_user.py +++ b/backend/helpers/kratos_user.py @@ -68,7 +68,7 @@ class KratosUser(): raise BackendError(f"Unable to get entry, kratos replied with: {error}", error) from error - def __repr__(self): + def __str__(self): return f"\"{self.name}\" <{self.email}>" @property