Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bugs fix.

  • Loading branch information...
commit 44a9efc75d5d1c0b5983afa36be5a87acb39dae3 1 parent aa78e73
whtsky authored
Showing with 3 additions and 1 deletion.
  1. +2 −0  tag.py
  2. +1 −1  templates/tag.html
View
2  tag.py
@@ -2,6 +2,7 @@
import math
from common import BaseHandler,time_span
+from config import admin
import time
import tornado.web
@@ -30,6 +31,7 @@ def get(self,tagname):
time_span=time_span,p=p,tag_sidebar=tag_sidebar)
def post(self,tagname):
+ assert self.current_user['username'] in admin
self.db.tags.update({'name':tagname},{'$set':{'sidebar':self.get_argument('sidebar','')}})
self.redirect('/tag/%s' % tagname)
View
2  templates/tag.html
@@ -28,7 +28,7 @@
{% block sidebar %}
{{tag_sidebar}}
-{% if current_user['username'] in admin_list %}
+{% if current_user and current_user['username'] in admin_list %}
<section class='box'>
<header><h3>修改边栏</h3></header>
<form method="post">
Please sign in to comment.
Something went wrong with that request. Please try again.