for name, value in self.cleaned_data.items():
if not isinstance(value, UploadedFile) and name != 'contact':
body[name] = value
for name, value in self.cleaned_data.items():
if not isinstance(value, UploadedFile) and name != 'contact':
body[name] = value
contact = Contact.objects.create(body=body,
ip=request.META['REMOTE_ADDR'],
contact=self.cleaned_data['contact'],
contact = Contact.objects.create(body=body,
ip=request.META['REMOTE_ADDR'],
contact=self.cleaned_data['contact'],
for name, value in self.cleaned_data.items():
if isinstance(value, UploadedFile):
attachment = Attachment(contact=contact, tag=name)
for name, value in self.cleaned_data.items():
if isinstance(value, UploadedFile):
attachment = Attachment(contact=contact, tag=name)