Hi

We are trying to set up our access control so that each app on our portal 
refers to the auth tables in its own postgresql schema. We are doing this 
because we would like each of our apps to require its own specific login 
credentials. The approach attempted thus far is that: immediately following 
the line "auth.define_tables(username=True, migrate=False, 
signature=False)" in the db.py model file the lines of code 1-6 below are 
added:

1. auth.table_user()._rname='app_clone 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>
.auth_user'
2. auth.table_event()._rname= app_clone 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>
.auth_event'
3. auth.table_membership()._rname = 'app_clone 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>
.auth_membership'
4. auth.table_permission()._rname = 'app_clone 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>
.auth_permission'
5. auth.table_group()._rname = 'app_clone 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>
.auth_group'
6. auth.table_cas()._rname = 'app_clone 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>
.auth_cas'

The auth tables in the app's postgresql app_clone schema are populated.

The problem is that the exception "int() argument must be a string or a 
number, not 'NoneType'" as shown below occurs if this is carried out.
If lines 1-6 are removed the auth tables in the public schema are referred 
to. These public schema auth tables are populated and the app works 
perfectly. 

What does the below error message mean and how can it be resolved?  Is the 
approach described above the correct approach? 

127.0.0.1.2017-03-02.10-06-44.72ded6de-fd1d-44ea-9486-cc47c5069e14
<type 'exceptions.TypeError'> int() argument must be a string or a number, 
not 'NoneType'
Version
web2py™ Version 2.14.6-stable+timestamp.2016.05.09.19.18.48
Python Python 2.7.9: /usr/bin/python (prefix: /usr)

Traceback (most recent call last):
File "/home/user/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/home/user/app_clone/controllers/default.py" 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>,
 
line 975, in <module>
File "/home/user/gluon/globals.py", line 417, in <lambda>
self._caller = lambda f: f()
File "/home/user/app_clone/controllers/default.py" 
<http://localhost:8000/admin/default/edit/journals_database_clone/controllers/default.py>,
 
line 8, in user
return dict(form=auth())
File "/home/user/web2py/gluon/tools.py", line 1939, in __call__
return getattr(self, args[0])()
File "/home/user/web2py/gluon/tools.py", line 3208, in login
self.log_event(log, user)
File "/home/user/web2py/gluon/tools.py", line 2537, in log_event
origin=origin, user_id=user_id)
File "/home/user/web2py/gluon/packages/dal/pydal/objects.py", line 745, in 
insert
ret = self._db._adapter.insert(self, self._listify(fields))
File "/home/user/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
732, in insert
id = self.lastrowid(table)
File "/home/user/web2py/gluon/packages/dal/pydal/adapters/postgres.py", 
line 171, in lastrowid
if self._last_insert:
TypeError: int() argument must be a string or a number, not 'NoneType'

<type 'exceptions.TypeError'>(int() argument must be a string or a number, 
not 'NoneType')

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to