Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb197f9

Browse files
committed
修复获取在线人数的bug
1 parent a264959 commit fb197f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

selfblog/blog/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def get_context_data(self, *args, **kwargs):
2323
context['recently_posts'] = Post.get_recently_posts(RECENTLY_NUM)
2424
context['hot_posts'] = Post.get_hots_posts(HOT_NUM)
2525
context['pages'] = Page.objects.filter(status=0)
26-
context['online_num'] = len(cache.get('online_ips'))
26+
context['online_num'] = len(cache.get('online_ips', []))
2727
except Exception as e:
2828
logger.exception(u'加载基本信息出错[%s]!', e)
2929

0 commit comments

Comments
 (0)