LINUX.ORG.RU

странная ошибка Python/Django


0

1
ValueError at /profiles/edit
dictionary update sequence element #0 has length 1; 2 is requiredRequest Method:	GET
Request URL:	http://127.0.0.1:8000/profiles/edit
Django Version:	1.2.5
Exception Type:	ValueError
Exception Value:	dictionary update sequence element #0 has length 1; 2 is required
Exception Location:	/usr/lib/pymodules/python2.7/django/core/urlresolvers.py in resolve, line 121
Python Executable:	/usr/bin/python
Python Version:	2.7.1
Python Path:	['/var/www/proect1', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/pymodules/python2.7/gtk-2.0', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/pymodules/python2.7/ubuntuone-storage-protocol', '/usr/lib/pymodules/python2.7/ubuntuone-client', '/usr/lib/pymodules/python2.7/ubuntuone-control-panel', '/usr/lib/pymodules/python2.7/libubuntuone', '/var/www/proect1/app/profiles', '/var/www/proect1/app/profiles']
Server time:	Чтв, 14 Июл 2011 16:09:20 +0300

вот такая странная ошибка выпадает если перейти на эту функцию


def edit_profile(request, form_class=YourProfileForm, success_url=None,
                 template_name='profiles/edit_profile.html',
                 extra_context=None):
  

    if success_url is None:
        success_url = reverse('profiles_profile_detail',
                              kwargs={ 'username': request.user.username })
    if form_class is None:
        form_class = utils.get_profile_form()
    if request.method == 'POST':
        form = form_class(data=request.POST, files=request.FILES, instance=profile_obj)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(success_url)
    else:
        form = form_class(instance=profile_obj)
    
    if extra_context is None:
        extra_context = {}
    context = RequestContext(request)
    for key, value in extra_context.items():
        context[key] = callable(value) and value() or value
    
    return render_to_response(template_name,
                              { 'form': form,
                                'profile': profile_obj, },
                              context_instance=context)

Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.