Added error messeage for import function if you are not superuser.

This commit is contained in:
Emanuel Schuetze 2011-09-09 10:55:33 +02:00
parent 475b7a1ffe
commit 72a2b824fd

View File

@ -236,7 +236,8 @@ def user_settings(request):
def user_import(request): def user_import(request):
try: try:
request.user.profile request.user.profile
raise NameError("you can not use this function with a User, that has a Profile") messages.error(request, _('The import function is available for the superuser (without user profile) only.'))
return redirect(reverse('user_overview'))
except Profile.DoesNotExist: except Profile.DoesNotExist:
pass pass