def METHOD_NAME(request, next_page=None):
    if request.method == 'POST':
        if 'next' in request.POST:
            next_page = request.POST['next']
        if 'reset-button' in request.POST:
            if 'admin_time' in request.session:
                del request.session['admin_time']
            return safe_redirect(request, next_page)
        elif is_real_superuser(request):
            current_admin_time = re.findall(r'\d+', request.POST['admin-time'])
            current_admin_time = list(map(int, current_admin_time))
            try:
                current_admin_time = datetime(*current_admin_time)
            except (ValueError, TypeError, OverflowError):
                messages.error(request, _("Invalid date. Admin-time was not set."))
                return safe_redirect(request, next_page)
            if current_admin_time.year >= 1900:
                local_tz = timezone.localtime().tzinfo
                request.session['admin_time'] = (
                    current_admin_time.replace(tzinfo=local_tz)
                    .astimezone(pytz.utc)
                    .isoformat()
                )
            else:
                messages.error(
                    request, _("Date has to be after 1900. Admin-time was not set.")
                )
            return safe_redirect(request, next_page)
    raise Http404