hack: fake default category in the view

This commit is contained in:
Martin Pépin 2018-01-04 22:11:27 +01:00
parent 4591fface7
commit 663f202149

View file

@ -99,6 +99,13 @@ def ajouter_morceau(request):
auteur=partitionset.auteur)
error = "Un morceau du même nom existe déjà"
except PartitionSet.DoesNotExist:
# XXX. Hideous
cat = Category.objects.first()
try:
cat = Category.objects.get(name="Partitions à venir")
except Category.DoesNotExist:
pass
partitionset.category = cat
partitionset.save()
sauvegarde = True
else: