mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 22:12:22 +01:00
Fix user not showing in list of songs.
This commit is contained in:
@ -2,7 +2,7 @@ import socket, struct, binascii
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def song_to_dict(song, hash=False):
|
||||
def song_to_dict(song, hash=False, user=False):
|
||||
data = {
|
||||
'id': song.id,
|
||||
'artist': song.artist,
|
||||
@ -13,8 +13,8 @@ def song_to_dict(song, hash=False):
|
||||
if hash:
|
||||
data['hash'] = song.hash
|
||||
|
||||
if hasattr(song, 'uploader_name') and song.uploader_name is not None and len(song.uploader_name) > 1:
|
||||
data['uploader_name'] = song.uploader_name
|
||||
if user and song.user is not None and len(song.user.name) > 1:
|
||||
data['uploader_name'] = song.user.name
|
||||
return data
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user