starlette-admin
starlette-admin copied to clipboard
Bug: URLField problem - list view is not showing any entities, not showing the filter controls, database has records
Describe the bug
The list view is not showing any entities, not showing the filter controls, not printing any errors to the console, but there are records in the database.
To Reproduce
I am not sure how to reproduce. It is happening locally (local postures) and just for 1 of my tables. On staging and production I do not see the problem.
UPDATE: Use URLField and have a malformed URL in the database, and described at the end here.
Is there a way to enable soft for or tracing of INFO or perhaps WARNINGS and/or ERRORS?
Environment (please complete the following information):
- Starlette-Admin version: 0.11.2
- ORM/ODMs: SQLAlchemy, psycopg2-binary==2.9.9
- SQLAlchemy-serializer==1.4.1
Additional context
- MacOS Ventura
- Postgress.app to run Postgress
- All other tables are ok
- Used to be ok 2 weeks ago. I did run an alembic migration on LOCALHOST, STAGING and PRODUCTION, removing some useless columns. Could it be a cache somewhere?
- How can I detect template exceptions etc?
No entities shown on LOCALHOST, despite database having records. Other entities are fine.
The problem is in the JS code for URLField:
What triggers the error is a malformed URL in the database column. My case:
https:/abcdefg.us.auth0.com/.well-known/openid-configuration
The URL is missing 1 "/". This makes URLField barf and no records will be shown.
I think a conditional field on this would be cool. Use URLField when it could be used, use StringField when it's not... I believe you can customize the field by your self, for a solution I should check the source code.
I already abandoned URLField. I suppose a good JS person can make it more solid.