Handle underscores in subreddit names in roadblocks.

This commit is contained in:
bsimpson63
2012-07-18 17:37:44 -04:00
parent 52db26df93
commit e12dbdd046

View File

@@ -231,7 +231,7 @@ def get_roadblocks():
rbs = g.hardcache.backend.ids_by_category(roadblock_prefix)
by_sr = {}
for rb in rbs:
rb = rb.split('_')
rb = rb.rsplit('_', 3) # subreddit_name_YYYY_MM_DD
date = datetime.strptime('_'.join(rb[1:]), "%Y_%m_%d").date()
by_sr.setdefault(rb[0], []).append((date, date + timedelta(1)))