if request.method == 'POST':
form = ProfileForm(request.POST, request.FILES or None, instance=profile)
if form.is_valid():
form.save()
else:
form = ProfileForm(instance=profile)
class ProfileForm(forms.ModelForm):
# skip initial details
def save(self, commit=True):
self.cleaned_data = dict([ (k,v) for k,v in self.cleaned_data.items() if v != "" ])
return super(ProfileForm, self).save(commit=commit)
{"img":["No file was submitted."]}