mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 05:59:55 +02:00
Fix #267: Do not crash when tag contains multiple uuids with a / separator
This commit is contained in:
parent
a16bd2a409
commit
7c47348855
3 changed files with 31 additions and 3 deletions
|
@ -91,10 +91,23 @@ def convert_track_number(v):
|
|||
pass
|
||||
|
||||
|
||||
|
||||
class FirstUUIDField(forms.UUIDField):
|
||||
def to_python(self, value):
|
||||
try:
|
||||
# sometimes, Picard leaves to uuids in the field, separated
|
||||
# by a slash
|
||||
value = value.split('/')[0]
|
||||
except (AttributeError, IndexError, TypeError):
|
||||
pass
|
||||
|
||||
return super().to_python(value)
|
||||
|
||||
|
||||
VALIDATION = {
|
||||
'musicbrainz_artistid': forms.UUIDField(),
|
||||
'musicbrainz_albumid': forms.UUIDField(),
|
||||
'musicbrainz_recordingid': forms.UUIDField(),
|
||||
'musicbrainz_artistid': FirstUUIDField(),
|
||||
'musicbrainz_albumid': FirstUUIDField(),
|
||||
'musicbrainz_recordingid': FirstUUIDField(),
|
||||
}
|
||||
|
||||
CONF = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue