summaryrefslogtreecommitdiffstats
path: root/profiles
diff options
context:
space:
mode:
Diffstat (limited to 'profiles')
-rw-r--r--profiles/utils.py8
-rw-r--r--profiles/views.py22
2 files changed, 18 insertions, 12 deletions
diff --git a/profiles/utils.py b/profiles/utils.py
index faacfcb..c2dfd61 100644
--- a/profiles/utils.py
+++ b/profiles/utils.py
@@ -7,7 +7,13 @@ site-specific user profile model specified in the
from django import forms
from django.conf import settings
-from django.contrib.auth.models import SiteProfileNotAvailable
+#from django.contrib.auth.models import SiteProfileNotAvailable
+
+try:
+ from django.contrib.auth.models import SiteProfileNotAvailable
+except ImportError: # django >= 1.7
+ SiteProfileNotAvailable = type('SiteProfileNotAvailable', (Exception,), {})
+
from django.db.models import get_model
diff --git a/profiles/views.py b/profiles/views.py
index c9552ab..b5b7143 100644
--- a/profiles/views.py
+++ b/profiles/views.py
@@ -14,31 +14,31 @@ from django.template import RequestContext
from django.views.generic.list import ListView
from django import forms
-from core.models import Person
+from troggle.core.models import Person
from profiles import utils
from django.conf import settings
class SelectPersonForm(forms.Form): #This and the select_profile view
- person = forms.ModelChoiceField(queryset=Person.objects.all())
+ person = forms.ModelChoiceField(queryset=Person.objects.all())
def select_profile(request):
if request.method == 'POST':
- form = SelectPersonForm(request.POST)
- if form.is_valid():
- profile_obj=form.cleaned_data['person']
- profile_obj.user=request.user
- profile_obj.save()
- return HttpResponseRedirect(profile_obj.get_absolute_url())
+ form = SelectPersonForm(request.POST)
+ if form.is_valid():
+ profile_obj=form.cleaned_data['person']
+ profile_obj.user=request.user
+ profile_obj.save()
+ return HttpResponseRedirect(profile_obj.get_absolute_url())
else:
form = SelectPersonForm()
- context = RequestContext(request)
+ context = RequestContext(request)
return render_to_response('profiles/select_profile.html', {
'form':form,},
- context_instance=context
- )
+ context_instance=context
+ )
def create_profile(request, form_class=None, success_url=None,