auth.settings.actions_disabled.append('register')

63 views
Skip to first unread message

Andrea Fae'

unread,
Mar 10, 2018, 2:42:43 PM3/10/18
to web2py-users
Sometimes problems arises. I need to eliminate "sign up" menu item from LOGIN but nevertheless I inserted this line

auth.settings.actions_disabled.append('register')

or this

auth.settings.actions_disabled = ['register']

in the db.py I can see the item in the menu, and when I click I see "404 NOT FOUND" page.

One time only this line could delete this menu item.

Do I forgot anything?
Thanks 

Al Ex

unread,
Mar 10, 2018, 10:34:49 PM3/10/18
to web...@googlegroups.com
What about removing this: 

<a class="dropdown-item" href="{{=URL('default','user/register')}}">{{=T('Sign up')}}</a>

from layout.html?
--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimo Di Pierro

unread,
Mar 16, 2018, 12:27:32 AM3/16/18
to web2py-users
That used to be done automatically when registration was disabled. It made the layout unnecessarily complex. Any action could be disabled and that;s a lot of if statements.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Andrea Fae'

unread,
Mar 16, 2018, 3:07:27 PM3/16/18
to web2py-users
Do you mean that, like in the other versions, it shoud be enogh only to write auth.settings.actions_disabled.append('register') and nothing more?
I see "password smarrita" in the menu and clicking it I see the same error 404 NOT FOUND and it points to "request_password" controller. Why if in the user function is written     http://..../[app]/default/user/retrieve_password ?
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Andrea Fae'

unread,
Mar 16, 2018, 3:25:06 PM3/16/18
to web2py-users
In layout.html there is an error...


wrong
              <!-- a class="dropdown-item" href="{{=URL('default','user/request_password')}}">{{=T('Lost Password')}}</a -->

right
              <a class="dropdown-item" href="{{=URL('default','user/retrieve_password')}}">{{=T('Lost Password')}}</a>

Alby Cartner

unread,
Mar 26, 2018, 11:47:25 AM3/26/18
to web2py-users
I am working on an app where it is not open for self registration.  I was getting the same error when I tried customising the Welcome app that was cloned.

I then retrieved the custom_Auth app from the examples, and uploaded that as my base and it works correctly just with

## configure auth policy
auth.settings.actions_disabled = ['register']

in the db.py file

The menu choice is gone.

I am still very new to Web2py so have no idea why one works and the other didn't - hope this helps.

Reply all
Reply to author
Forward
0 new messages