Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Retains end date in event edit on erroneus entry
Browse files Browse the repository at this point in the history
As per issue [#307](#307) , the `end-date` field would go blank after saving the form with blank `start-date` field (which goes blank on an erroneous entry). This PR resolves the issue by retaining all the entries of the field including the `end-date` field.
  • Loading branch information
malabikasen committed Apr 28, 2016
1 parent c7b8123 commit 3aef004
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vms/event/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def edit(request, event_id):
form.save()
return HttpResponseRedirect(reverse('event:list'))
else:
data = request.POST.copy()
data['end_date'] = form.cleaned_data['end_date']
form = EventForm(data)
return render(request, 'event/edit.html', {'form': form, })
else:
form = EventForm(instance=event)
Expand Down

0 comments on commit 3aef004

Please sign in to comment.