edx/edx-platform — pull request #4868 by bradenmacdonald (2014-08-18 15:37:21+00:00)
Title: Fixed: Can set earlier due date as an individual due date extension and related bugs

This pull request fixes [LMS-6563: Can enter in earlier date in Individual Extension](https://openedx.atlassian.net/browse/LMS-6563), which was also mentioned in the individual due date extensions feature PR #2062.

Now an error will occur if the instructor attempts to set a due date that is earlier than the original due date.

I also fixed two related bugs that I noticed while working on this:
* The API would allow setting a due date extension on a unit that had no due date at all. This now returns an error.
* If one set an individual due date extension, then deleted the original due date, an Internal Server Error (500) would occur when deleting the due date extension, and neither a success nor failure message would be shown to the user.

Unit tests are included.

This was done for OpenCraft ( cc @antoviaque ) and falls under their organization contributor agreement.