Add constructor for User class

This was causing issues where appending to any of the lists would update the class variable rather than the instance variable, leading to everyone having the same likes, tracks, etc.
This commit is contained in:
Thomas Wade 2018-09-25 19:01:07 +09:30
parent 9e9a56386f
commit 0c496ecd71

View File

@ -48,11 +48,18 @@ class User:
following_count = None following_count = None
follower_count = None follower_count = None
tracks = [] tracks = None
likes = [] likes = None
followers = [] followers = None
following = [] following = None
def __init__(self):
self.tracks = []
self.likes = []
self.followers = []
self.following = []
class Track: class Track:
url = '' url = ''