multiple companies error

6 views
Skip to first unread message

Tonu Mikk

unread,
Dec 18, 2008, 11:45:08 AM12/18/08
to rancho...@googlegroups.com
Hi,

I had created two companies within Rancho. This worked. I then wanted
to enable Django's default admin functionality. I added
django.contrib.admin to Installed Apps in settings.py, did "python
manage.py syncdb". and I modified urls.py to include

*from django.contrib import admin*
*admin.autodiscover()*

(r'^admin/(.*)', admin.site.root)

**

. I then began getting the error below. I commented out the changes
that I made, but I am still received the error. This is with Rancho
revision 31 and mysql database running with mod_wsgi from Apache.

Tonu


MultipleObjectsReturned at /auth/login/

get() returned more than one Company -- it returned 2! Lookup parameters were {'main_company': True}

Request Method: GET
Request URL: http://rancho.dmc.umn.edu/auth/login/
Exception Type: MultipleObjectsReturned
Exception Value:

get() returned more than one Company -- it returned 2! Lookup parameters were {'main_company': True}

Exception Location:
/usr/lib/python2.5/site-packages/django/db/models/query.py in get, line 311


Tonu Mikk

unread,
Dec 19, 2008, 10:03:00 AM12/19/08
to rancho...@googlegroups.com
Hi, I was able to resolve the multiple company error. For some reason
there were two main companies created. I discovered this when looking
at the MySQL companies table (picture attached). I deleted the last row
and the application started to work again. I am not sure what caused
two main companies to be inserted into the database. I don't think that
enabling the admin interface had anything to do with it. I was able to
enable the admin interface now and everything is working.

Tonu
--
Tonu Mikk
Educational Technology Consultant
Digital Media Center - dmc.umn.edu
tm...@umn.edu 612 625-9221

company error.gif

ranc...@gmail.com

unread,
Dec 19, 2008, 8:40:10 PM12/19/08
to Rancho
I Tonu,

Sorry but with the amount of work we couldn't answer you earlier.

It seems that when you did syncdb you already had a DB and hence a
main company created, so, there were two main companies which cannot
occur.

We're glad you could solve it.


Best Regards,

--
The Rancho Team
>  company error.gif
> 13KViewDownload
Reply all
Reply to author
Forward
0 new messages