django-scheduler icon indicating copy to clipboard operation
django-scheduler copied to clipboard

Next URL after editing occurrence should be in calendar view which is editing

Open sushovan23 opened this issue 8 years ago • 2 comments

I have implemented editing occurrence of events in latest version similar to version 0.7.5

@check_event_permissions
def cancel_occurrence(request, event_id, template_name='event/cancel_occurrence.html', *args, **kwargs):
    """
    This view is used to cancel an occurrence. If it is called with a POST it
    will cancel the view. If it is called with a GET it will ask for
    conformation to cancel.
    """

    event, occurrence = get_occurrence(event_id, *args, **kwargs)
    next = kwargs.get('next', None) or get_next_url(request, event.get_absolute_url())
    if request.method != "POST":
        return render_to_response(template_name, {
            "occurrence": occurrence,
            "next": next,
        }, context_instance=RequestContext(request))
    occurrence.cancel()
    return HttpResponseRedirect(next)

With older version it used to cancel the occurrence and return to the calender view of either daily view or weekly view of that date/week from which the action was triggered.

In the latest version it tries to navigate to event id view. Is there something which I'm missing or if not can someone tell me how to get the old functionality back of being able to go back to view from where the action was triggered? The function didn't change but behavior has changed after upgrading. Please let me know what is the way to get previous functionality working again?

sushovan23 avatar Jan 26 '17 00:01 sushovan23

Similar behavior noticed in delete event also. Any advice on how to achieve redirection to that view would be highly appreciated. Similar methods in 0.7.5 were working. I must be missing something which I'm not able to figure out yet.

sushovan23 avatar Jan 26 '17 00:01 sushovan23

@llazzaro could you shed some light into this?

sushovan23 avatar Jan 26 '17 14:01 sushovan23