Fixing issue with PuSH hub topic's being too long for the db.

This commit is contained in:
Samuel Clay 2012-04-01 20:33:42 -07:00
parent 57ebbb0790
commit 6b202ebba5

View file

@ -34,7 +34,10 @@ class PushSubscriptionManager(models.Manager):
subscription, created = self.get_or_create(feed=feed)
signals.pre_subscribe.send(sender=subscription, created=created)
subscription.set_expiration(lease_seconds)
subscription.topic = topic
if len(topic) < 200:
subscription.topic = topic
else:
subscription.topic = feed.feed_link[:200]
subscription.hub = hub
subscription.save()