Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove only_use_forum_url

  • Loading branch information...
commit 7cb93931900d48f242541ad4b30ea6cfe852f09e 1 parent 63cd5b2
@whtsky whtsky authored
Showing with 7 additions and 13 deletions.
  1. +7 −9 handlers/__init__.py
  2. +0 −2  main.py
  3. +0 −2  settings.py
View
16 handlers/__init__.py
@@ -14,15 +14,6 @@
class BaseHandler(tornado.web.RequestHandler, RecaptchaMixin):
- def prepare(self):
- if self.request.remote_ip != '127.0.0.1' and \
- self.request.host != self.settings['host']:
- self.redirect(self.settings['forum_url'] + self.request.uri[1:],
- permanent=True)
-
- messages = self.get_secure_cookie('flash_messages')
- self.messages = messages and tornado.escape.json_decode(messages) or []
-
def get_current_user(self):
password = self.get_secure_cookie('user')
member = self.application.db.members.find_one({'password': password})
@@ -62,6 +53,13 @@ def get_source(self):
@property
def db(self):
return self.application.db
+
+ @property
+ def messages(self):
+ if hasattr(self, 'messages'):
+ return self.messages
+ messages = self.get_secure_cookie('flash_messages')
+ self.messages = messages and tornado.escape.json_decode(messages) or []
def get_member(self, name):
name = name.lower()
View
2  main.py
@@ -29,8 +29,6 @@ def __init__(self):
if 'static_path' not in settings:
settings['static_path'] = os.path.join(ROOT, "static")
- settings['host'] = settings['forum_url'].split('/')[2]
-
super(Application, self).__init__(urls.handlers,
ui_modules=urls.ui_modules, login_url='/account/signin',
**settings)
View
2  settings.py
@@ -8,8 +8,6 @@
forum_title = 'site_name'
forum_url = 'http://xxx.com/'
# forum_url MUST ends with '/'
-only_use_forum_url = True
-#Will redirect all the request to the forum url if True.
#static_path = ''
#static_url_prefix = 'http://assets.xxx.com'
Please sign in to comment.
Something went wrong with that request. Please try again.