So I decided to give my problem a try, here is the code: import datetime def index(): current_date = request.now - datetime.timedelta(days=0) if db(db.expiry_date_table.expiry_date < current_date ): redirect(URL('subscribe')) return locals()
But now the problem is that its always redirecting, it does not respect the condition of the if statement even if the expiry date is greater than the current_date! How can i emprove this to work right? Regards; Mostwanted On Sunday, August 18, 2019 at 12:26:13 PM UTC+2, mostwanted wrote: > > I am trying to create a subscription enforcement functionality here, i > have not written the code because i do not know where to start, what i want > is after 3 months log out a user & redirect them to the subscription page & > if they are not logged in if they try to log in when their subscription has > expired get logged out immediately & be redirected to the subscription > page. At the subscription page they should not be able to access any menu > at all till after they have renewed their subscription. > > Regards; > > Mostwanted. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/bf4f06ee-d392-4cbc-be9c-cf9734e3e5bf%40googlegroups.com.