Skip to content

Instantly share code, notes, and snippets.

@mccutchen
Created October 4, 2013 18:59
Show Gist options
  • Select an option

  • Save mccutchen/6830930 to your computer and use it in GitHub Desktop.

Select an option

Save mccutchen/6830930 to your computer and use it in GitHub Desktop.
The worst commit of my life.
commit 7b4e29d030812813e29f7008da45502a68a583b3
Author: Will McCutchen <will@mccutch.org>
Date: Fri Oct 4 18:45:10 2013 +0000
api: allow 0 as rescheduling duration.
The actual work of magically rescheduling to today in that case is
left as an exercise for Snakes.
diff --git a/api_v1/app/pattern.py b/api_v1/app/pattern.py
index fa89d5b..c96f1f3 100644
--- a/api_v1/app/pattern.py
+++ b/api_v1/app/pattern.py
@@ -222,7 +222,7 @@ class StepHandler(BaseHandler):
if action == 'RESCHEDULE':
duration = int(self.json_body.get('duration', 0))
- if duration < 1 or duration > 30:
+ if duration != 0 and (duration < 1 or duraction > 30):
raise tornado.web.HTTPError(400, 'INVALID_ARG_DURATION')
try:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment