예제 #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('/')