If you change start/end of an event which has some persisted occurrences, the original occurrences reappear thus causing duplication (reported by gautamadude).
There is a test which currently fails.
There is a reference page with some insight here: https://github.com/bartekgorny/django-schedule/wiki/Modifying-events - solving the issue requires some design decisions relating to logic rathere then implementation.
I fixed this by doing the following:
def _get_occurrence_list(self, start, end):
But I'm not sure if this breaks anything elsewhere... everything worked in my project..
This worked for me because:
No new tests fail, I get 2 failed tests with HEAD but the change doesn't introduce any new failures.
The broken tests are testing for "orphaned" occurrences, however.. it is the "exception" occurrences that are tested.
As you said it is a design decision and one that I am not in a position to make, however, I do feel that exceptions to a rule are no longer part of that rule, as they would break it.
The main point of this change is as follows:
edit - it seems this only fixes one side of the issue.. I'm working on a better fix now
the best thing I can think of is to use "sequences"
Unfortunately in order to "properly" fix it, I ended up "updating" the start and end dates for occurrences:
The tests all pass with the above commit but.. the solution isn't exactly ideal.. it works for my project though. I'll leave you to decide :)
Note: There is a print statement that wasn't meant to be there, sorry.