Reduced number of queries for BlogView.get_entries_by_tag. Corrected waldo's AccountM...
[philo.git] / contrib / waldo / models.py
index e3dd079..c537ba9 100644 (file)
@@ -379,18 +379,9 @@ class AccountMultiView(LoginMultiView):
                return self.manage_account_page.render_to_response(request, extra_context=context)
        
        def has_valid_account(self, user):
                return self.manage_account_page.render_to_response(request, extra_context=context)
        
        def has_valid_account(self, user):
-               user_form, profile_form = self.get_account_forms()
-               forms = []
-               forms.append(user_form(data=get_field_data(user, self.user_fields)))
-               
-               if profile_form is not None:
-                       profile = self.account_profile._default_manager.get_or_create(user=user)[0]
-                       forms.append(profile_form(data=get_field_data(profile, self.account_profile_fields)))
-               
-               for form in forms:
-                       if not form.is_valid():
-                               return False
-               return True
+               form = self.account_form(user, {})
+               form.data = form.initial
+               return form.is_valid()
        
        def account_required(self, view):
                def inner(request, *args, **kwargs):
        
        def account_required(self, view):
                def inner(request, *args, **kwargs):