Follow-up from "Update track table"
The following discussion from !1309 (merged) should be addressed:
-
@mjourdan started a discussion: (+1 comment) It seems some actions under the [⋅⋅⋅] button of a track don't work:
- play radio
- add to playlist
api_1 | 2021-10-21T11:54:31.092615759Z /venv/lib/python3.8/site-packages/requests_http_signature/__init__.py:25: CryptographyDeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.
api_1 | 2021-10-21T11:54:31.092650134Z signer = key.signer(padding=self.PKCS1v15(), algorithm=hasher)
api_1 | 2021-10-21T11:54:31.092656854Z 2021-10-21 11:54:31,092 django.request ERROR Internal Server Error: /api/v1/radios/tracks/
api_1 | 2021-10-21T11:54:31.092661759Z Traceback (most recent call last):
api_1 | 2021-10-21T11:54:31.092666170Z File "/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
api_1 | 2021-10-21T11:54:31.092671399Z response = get_response(request)
api_1 | 2021-10-21T11:54:31.092675770Z File "/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
api_1 | 2021-10-21T11:54:31.092680430Z response = wrapped_callback(request, *callback_args, **callback_kwargs)
api_1 | 2021-10-21T11:54:31.092684894Z File "/usr/lib/python3.8/contextlib.py", line 75, in inner
api_1 | 2021-10-21T11:54:31.092689588Z return func(*args, **kwds)
api_1 | 2021-10-21T11:54:31.092694017Z File "/venv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
api_1 | 2021-10-21T11:54:31.092698604Z return view_func(*args, **kwargs)
api_1 | 2021-10-21T11:54:31.092702935Z File "/venv/lib/python3.8/site-packages/rest_framework/viewsets.py", line 125, in view
api_1 | 2021-10-21T11:54:31.092707621Z return self.dispatch(request, *args, **kwargs)
api_1 | 2021-10-21T11:54:31.092712111Z File "/venv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
api_1 | 2021-10-21T11:54:31.092716655Z response = self.handle_exception(exc)
api_1 | 2021-10-21T11:54:31.092720926Z File "/venv/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
api_1 | 2021-10-21T11:54:31.092744589Z self.raise_uncaught_exception(exc)
api_1 | 2021-10-21T11:54:31.092750163Z File "/venv/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
api_1 | 2021-10-21T11:54:31.092754858Z raise exc
api_1 | 2021-10-21T11:54:31.092759256Z File "/venv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
api_1 | 2021-10-21T11:54:31.092763804Z response = handler(request, *args, **kwargs)
api_1 | 2021-10-21T11:54:31.092768179Z File "/app/funkwhale_api/radios/views.py", line 140, in create
api_1 | 2021-10-21T11:54:31.092772670Z session.radio.pick()
api_1 | 2021-10-21T11:54:31.092777030Z File "/app/funkwhale_api/radios/radios.py", line 88, in pick
api_1 | 2021-10-21T11:54:31.092781657Z return self.pick_many(quantity=1, **kwargs)[0]
api_1 | 2021-10-21T11:54:31.092786016Z File "/app/funkwhale_api/radios/radios.py", line 92, in pick_many
api_1 | 2021-10-21T11:54:31.092790497Z picked_choices = super().pick_many(choices=choices, quantity=quantity)
api_1 | 2021-10-21T11:54:31.092794937Z File "/app/funkwhale_api/radios/radios.py", line 28, in pick_many
api_1 | 2021-10-21T11:54:31.092800387Z return random.sample(set(choices), quantity)
api_1 | 2021-10-21T11:54:31.092805032Z File "/usr/lib/python3.8/random.py", line 363, in sample
api_1 | 2021-10-21T11:54:31.092809798Z raise ValueError("Sample larger than population or is negative")
api_1 | 2021-10-21T11:54:31.092814345Z ValueError: Sample larger than population or is negative