Fixing trim user stories on malformed story hash.

This commit is contained in:
Samuel Clay 2013-10-07 13:57:13 -07:00
parent 8401c97c59
commit 87f7ff785d

View file

@ -433,7 +433,11 @@ class UserSubscription(models.Model):
missing_rs = []
feed_re = re.compile(r'(\d+):.*?')
for rs in old_rs:
rs_feed_id = feed_re.search(rs).groups()[0]
found = feed_re.search(rs)
if not found:
print " ---> Not found: %s" % rs
continue
rs_feed_id = found.groups()[0]
if int(rs_feed_id) not in feeds:
missing_rs.append(rs)
# r.sadd("RS:%s" % user_id, *missing_rs)