feat(usermodel): add repr method to User class

This commit is contained in:
Julian Lobbes 2022-11-11 01:32:38 +01:00
parent 5fcbb6321f
commit 168fd34174

View File

@ -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