hack: fake default category in the view
This commit is contained in:
parent
4591fface7
commit
663f202149
1 changed files with 7 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue