﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12776	get_profile() may throw AttributeError instead of SiteProfileNotAvailable	master	nobody	"I didn't find a case to fire:[[BR]]
except (ImportError, ImproperlyConfigured)

But some others cases :

In AUTH_PROFILE_MODULE, if:

- you don't provide a '.': 'accountsUserProfile'[[BR]]
==> ValueError

- you mispell or forget the app_label part or the model_name part: 'accounts.', 'accXXXounts.UserProfile'[[BR]]
No exception is raised and the variable 'model' is returned as None.[[BR]]
==> AttributeError on following line: 'NoneType' object has no attribute '_default_manager'

I needed something similar for my own code, that I wrote as:

{{{
try:
    ...
    model = ...
    if not model:
        raise SiteProfileNotAvailable
    ...
except ValueError:
        raise SiteProfileNotAvailable
}}}
"		closed	contrib.auth	1.1		fixed	profile		Ready for checkin	1	0	0	0	0	0
