Commit 6b7fda14 authored by fred's avatar fred

do not create a duplicated nonstop file object on duplicate upload

parent f0ea5ae9
......@@ -217,12 +217,15 @@ class UploadTracksView(FormView):
artist, created = Artist.objects.get_or_create(name=artist_name)
track, created = Track.objects.get_or_create(title=track_title, artist=artist,
defaults={'uploader': self.request.user})
nonstop_file.track = track
if created:
nonstop_file.track = track
pass # do not create a duplicated nonstop file object
if request.POST.get('nonstop_zone'):
track.sync_nonstop_zones(), '%d new track(s)' % len(tracks))
return self.form_valid(form)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment