from django.conf import settings
from django.core.mail import EmailMessage
from django.db.models import Max
+from django.db.utils import IntegrityError
from patchwork.forms import MultiplePatchForm
from patchwork.models import Bundle, Project, BundlePatch, UserProfile, \
PatchChangeNotification, EmailOptout
if not bundle_name:
return ['No bundle name was specified']
+ if Bundle.objects.filter(owner = user, name = bundle_name).count() > 0:
+ return ['You already have a bundle called "%s"' % bundle_name]
+
bundle = Bundle(owner = user, project = project,
name = bundle_name)
bundle.save()