77class Question :
88 def __init__ (self , topic , body ):
99 self .id = uuid .uuid4 ().int
10- self .topic = topic .strip ()
11- self .body = body .strip ()
10+ self .topic = str ( topic ) .strip ()
11+ self .body = str ( body ) .strip ()
1212
1313 def __repr__ (self ):
1414 return {
@@ -21,7 +21,7 @@ def __repr__(self):
2121class Answer :
2222 def __init__ (self , body , Qn_Id , pref = False ):
2323 self .answerId = uuid .uuid4 ().int
24- self .body = body .strip ()
24+ self .body = str ( body ) .strip ()
2525 self .Qn_Id = Qn_Id
2626 self .prefered = pref
2727
@@ -33,16 +33,16 @@ def __repr__(self):
3333 'prefered' : self .prefered
3434 }
3535
36- def prefer_answer (self , answer ):
37- answer .prefered = True
36+ def prefer_answer (self ):
37+ self .prefered = True
3838
3939
4040class User :
4141 def __init__ (self , username , email , password ):
4242 self .salt = bcrypt .gensalt ()
4343 self .id = uuid .uuid4 ().int
44- self .username = username .strip ()
45- self .email = email .strip ()
44+ self .username = str ( username ) .strip ()
45+ self .email = str ( email ) .strip ()
4646 self .password_hash = generate_password_hash (password )
4747
4848 def __repr__ (self ):
0 commit comments