示例#1
0
文件: post.py 项目: AHAMED750/reddit
 def POST_over18(self, over18, dest):
     if over18 == 'yes':
         if c.user_is_loggedin and not c.errors:
             c.user.pref_over_18 = True
             c.user._commit()
         else:
             set_over18_cookie()
         return self.redirect(dest)
     else:
         if c.user_is_loggedin and not c.errors:
             c.user.pref_over_18 = False
             c.user._commit()
         else:
             delete_over18_cookie()
         return self.redirect('/')
示例#2
0
 def POST_over18(self, over18, dest):
     if over18 == 'yes':
         if c.user_is_loggedin and not c.errors:
             c.user.pref_over_18 = True
             c.user._commit()
         else:
             set_over18_cookie()
         return self.redirect(dest)
     else:
         if c.user_is_loggedin and not c.errors:
             c.user.pref_over_18 = False
             c.user._commit()
         else:
             delete_over18_cookie()
         return self.redirect('/')