Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I fix SiteProfileNotAvailable exception #88

Open
channaitfac opened this issue Jul 14, 2015 · 5 comments
Open

How can I fix SiteProfileNotAvailable exception #88

channaitfac opened this issue Jul 14, 2015 · 5 comments

Comments

@channaitfac
Copy link

I have I configured and deploy the application. But when I going to read some comment I will get following exception,

Exception Type: SiteProfileNotAvailable
Exception Value: You need to set AUTH_PROFILE_MODULE in your project settings

But I haven't any idea to how too set proper value for "AUTH_PROFILE_MODULE" (under src\collab\collab\settings.py).

Now I am using following values,

application name is 'idea'
I have created user call 'dev'

AUTH_PROFILE_MODULE = 'idea.dev'

Can you please tell me how can I derive that values ?

Thanks.

@m3brown
Copy link
Contributor

m3brown commented Jul 14, 2015

Try setting AUTH_PROFILE_MODULE to 'auth.User', which is the default Django user model.

Let me know if that addresses the issue. If so, I'll update the README accordingly, it appears to be a requirement for the comment module to function properly.

@channaitfac
Copy link
Author

Many thanks for your worth full answer.

I have applied the value as you have mention (on settings.py file),
AUTH_PROFILE_MODULE = 'auth.User'

But still I am getting same exception.

This exception occur when I going to,

  • post new "Comment" for existing "Idea" (even exception occurred, that new comment was added to relevant idea, when I check the data base those new comments records are existing)
  • view existing "Comment"
  • view existing "Idea" which having some "Comments".

Note:-
When I select records in "django_comments" table,
table column "is_removed" contains value "false" for all records.
When I update that value as "true" (UPDATE django_comments SET is_removed = true;) then application works with out any errors.
But when I add another new "Comment", again it will contains "false" for "is_removed" filed.
Then again I can not view that Comment and then I have to update that value to "true".

But I can proceed other operations without any issue, ex: post new "Idea" and do "Like" it .

I have remove the "projectegg = idea" entry on buildout.cfg file because it course to
"Error: The projectegg option is deprecated" with "buildout" command. .

Other than that I have proceeded only basic configuration steps that mention on read me file.

I have posted detail exception message and relevant trace values as bellow,

Can you please help me to resolve this issue.

Thanks a lot.

----------- Exception detail -----------------
SiteProfileNotAvailable at /detail/2/
You need to set AUTH_PROFILE_MODULE in your project settings

Request Method: GET
Request URL: http://127.0.0.1:8000/detail/2/
Django Version: 1.5.4
Exception Type: SiteProfileNotAvailable
Exception Value: You need to set AUTH_PROFILE_MODULE in your project settings
Exception Location: c:\python27\lib\site-packages\django\contrib\auth\models.py in get_profile, line 435
Python Executable: C:\Python27\python.exe
Python Version: 2.7.9

----------- Trace values -----------------
c:\python27\lib\site-packages\django\contrib\auth\models.py in get_profile
435. 'You need to set AUTH_PROFILE_MODULE in your project '

▼ Local vars
Variable Value
self "User: dev"
settings "django.conf.LazySettings object at 0x01E64BB0"

@m3brown
Copy link
Contributor

m3brown commented Jul 17, 2015

Okay, so I was able to recreate the comment issue. It looks like the code here is not able to run get_profile using the auth.User model. The erroring line in auth.User is here. I don't currently have time to dig into a proper fix, but perhaps the easiest solution is to create a template tag to safely run and catch get_profile and return None if SiteProfileNotAvailable is thrown.

@m3brown
Copy link
Contributor

m3brown commented Jul 17, 2015

Also, note this doesn't impact CFPB's system because we run ideabox inside of collab, and the CollabUser/Person combo resolves get_profile() without any issues.

@panduit-bew
Copy link

I am getting the following:
FieldError at /idea/detail/2/
Cannot resolve keyword 'user' into field. Choices are: comment_comments, comment_flags, date_joined, email, first_name, groups, id, idea, idea_vote_creator, is_active, is_staff, is_superuser, last_login, last_name, logentry, password, taggit_taggeditem_related, user_permissions, username, vote

Is this because it should be username instead of user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants