X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/82c3054bcdeb000aa9782da80d644070797b5cbe..ae60b2a3949e96357477cc04f90fd0873cee8a92:/apps/api/helpers.py diff --git a/apps/api/helpers.py b/apps/api/helpers.py deleted file mode 100644 index 62578e7c3..000000000 --- a/apps/api/helpers.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from time import mktime -from piston.resource import Resource - -def timestamp(dtime): - "converts a datetime.datetime object to a timestamp int" - return int(mktime(dtime.timetuple())) - -class CsrfExemptResource(Resource): - """A Custom Resource that is csrf exempt""" - def __init__(self, handler, authentication=None): - super(CsrfExemptResource, self).__init__(handler, authentication) - self.csrf_exempt = getattr(self.handler, 'csrf_exempt', True)