From 168fd34174cb3ca0d4aabb91a67439d83ce249b8 Mon Sep 17 00:00:00 2001 From: Julian Lobbes Date: Fri, 11 Nov 2022 01:32:38 +0100 Subject: [PATCH] feat(usermodel): add repr method to User class --- lumi2/usermodel.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lumi2/usermodel.py b/lumi2/usermodel.py index ea8ee5e..9a6a20f 100644 --- a/lumi2/usermodel.py +++ b/lumi2/usermodel.py @@ -248,3 +248,10 @@ class User: if not User.is_valid_picture(picture): raise ValueError(f"Not a valid image: '{picture}'.") self.picture = picture + + + def __repr__(self): + repr_str = f'User("{self.username}", "{self.password_hash}", ' \ + f'"{self.email}", "{self.first_name}", "{self.last_name}", ' \ + f'"{self.display_name}", "{self.picture}")' + return repr_str