def post(self, request, *args, **kwargs):
        offset = request.POST.get('offset', None)
        if not offset:
            return HttpResponse("No 'offset' parameter provided", status=400)

        try:
            offset = int(offset)
        except __HOLE__:
            return HttpResponse("Invalid 'offset' value provided", status=400)

        request.session['detected_tz'] = int(offset)

        return HttpResponse("OK")
dataset/ETHPy150Open adamcharnock/django-tz-detect/tz_detect/views.py/SetOffsetView.post