I have this UpdateView subclass
class UpdateShipView(UpdateView):
form_class = CruiseShipForm
template_name = 'cruise/ship_form.html'
success_url = 'cruise/ships'
def get_object(self, queryset=None):
obj = CruiseShip.objects.get(pk=self.kwargs['ship_id'])
return obj
I want to send an email to certain people with this code:
def form_valid():
msg = 'bla bla'
send_mail('Cruise Ship change: ', msg, 'offer_entry@ensembletravel.com',
user_emails, fail_silently=False)
return super(UpdateShipView, self).form_valid()
I get this error:
Django Version: 1.3.1
Exception Type: TypeError
Exception Value: form_valid() takes no arguments (2 given)
I believe I need to re-write form_valid() method but at this point I haven’t seen an example to guide me
I wanted to follow up with what I finally got to work.