# HG changeset patch # User Peter Sanchez # Date 1289346523 28800 # Tue Nov 09 15:48:43 2010 -0800 # Node ID 1d4d98b1bface3539fd0bea23887f9b34a8762c4 # Parent 1eb9dc60217eedc4201fcba21397834e1e667510 Updated template tags for bug when not passing in a limit diff --git a/twittersync/templatetags/twittersync_tags.py b/twittersync/templatetags/twittersync_tags.py --- a/twittersync/templatetags/twittersync_tags.py +++ b/twittersync/templatetags/twittersync_tags.py @@ -62,8 +62,15 @@ if limit is None: limit = getattr(settings, 'TWITTERSYNC_LATEST_TWEETS', 5) + try: + # needed because it may not be passed via the + # template token. + limit = parser.compile_filter(limit) + except TypeError: + pass + return LatestTweets( parser.compile_filter(account), - parser.compile_filter(limit), + limit, parser.compile_filter(varname), )