#10718 closed (invalid)
Something's wrong with your database installation, make sure the database is readable by the appropriate user.
Reported by: | Praveen | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.0 |
Severity: | Keywords: | Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user. | |
Cc: | praveen.python.plone@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
def queryset(self, request): qs = super(EventAdmin, self).queryset(request) if not request.user.is_superuser: qs = qs.filter(city=request.user.get_profile().res_city) return qs
it works fine as but it list out all the city's events
def queryset(self, request): qs = super(EventAdmin, self).queryset(request) if request.user.is_superuser: qs = qs.filter(city=request.user.get_profile().res_city) return qs
but when i change the if condition it gives error message
Database error
Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user.
Note:
See TracTickets
for help on using tickets.
The error message likely means exactly what it says: there's something wrong with your database installation. Either you haven't created the tables needed to run request.user.get_profile() or the user specified in settings.py doesn't have permission to read it/them. You don't indicate you have done anything to fix or verify that that is not in fact the problem, so I doubt there is any bug in Django here. If you need help figuring out how to fix the problem with your database, post to django-users. The ticket tracker is for reporting issues with Django itself, not usage help.