From 2d22d09c88c3daf29a711dd59312c3b00ab48265 Mon Sep 17 00:00:00 2001 From: Belen-mapplas Date: Wed, 11 Jun 2014 08:12:51 +0000 Subject: [PATCH] Added year option to throtting. --- rest_framework/throttling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py index 91be9cfd5..bddefe2c6 100644 --- a/rest_framework/throttling.py +++ b/rest_framework/throttling.py @@ -83,7 +83,7 @@ class SimpleRateThrottle(BaseThrottle): return (None, None) num, period = rate.split('/') num_requests = int(num) - duration = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}[period[0]] + duration = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400, 'y': 31536000}[period[0]] return (num_requests, duration) def allow_request(self, request, view):