Skip to content

Commit

Permalink
bugs fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
whtsky committed Apr 8, 2012
1 parent aa78e73 commit 44a9efc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tag.py
Expand Up @@ -2,6 +2,7 @@


import math import math
from common import BaseHandler,time_span from common import BaseHandler,time_span
from config import admin
import time import time
import tornado.web import tornado.web


Expand Down Expand Up @@ -30,6 +31,7 @@ def get(self,tagname):
time_span=time_span,p=p,tag_sidebar=tag_sidebar) time_span=time_span,p=p,tag_sidebar=tag_sidebar)


def post(self,tagname): def post(self,tagname):
assert self.current_user['username'] in admin
self.db.tags.update({'name':tagname},{'$set':{'sidebar':self.get_argument('sidebar','')}}) self.db.tags.update({'name':tagname},{'$set':{'sidebar':self.get_argument('sidebar','')}})
self.redirect('/tag/%s' % tagname) self.redirect('/tag/%s' % tagname)


Expand Down
2 changes: 1 addition & 1 deletion templates/tag.html
Expand Up @@ -28,7 +28,7 @@
{% block sidebar %} {% block sidebar %}
{{tag_sidebar}} {{tag_sidebar}}


{% if current_user['username'] in admin_list %} {% if current_user and current_user['username'] in admin_list %}
<section class='box'> <section class='box'>
<header><h3>修改边栏</h3></header> <header><h3>修改边栏</h3></header>
<form method="post"> <form method="post">
Expand Down

0 comments on commit 44a9efc

Please sign in to comment.