Created attachment 2387 [details] crashed_toaster_project_page Hi, For 1.8 M2 RC2, commit: 22c38e2d8a058619e3d05534b5e830b750aa4241, for a particular project, the configuration page ("Edit configuration variables") allow users to add two or more variables having the same name as the one that is already added. This is causing toaster project configuration page to crash. select name, value from orm_projectvariable; name = IMAGE_INSTALL_append value = name = PACKAGE_CLASSES value = package_rpm name = MACHINE value = genericx86-64 name = SDKMACHINE value = x86_64 name = DISTRO value = poky name = IMAGE_FSTYPES value = ext3 jffs2 tar.bz2 name = MACHINE value = qemux86 Below the traceback from toaster_web.log: Internal Server Error: /toastergui/project/1/ Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/ionut/work/poky_1.8/poky/bitbake/lib/toaster/toastergui/views.py", line 2056, in project context["machine"] = {"name": prj.projectvariable_set.get(name="MACHINE").value} File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 143, in get return self.get_query_set().get(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 405, in get (self.model._meta.object_name, num, kwargs)) MultipleObjectsReturned: get() returned more than one ProjectVariable -- it returned 2! Lookup parameters were {'name': 'MACHINE'} [04/Feb/2015 15:39:48] "GET /toastergui/project/1/ HTTP/1.1" 500 86331 Attached the screen shot with the crashed page. Cheers, Ionut C
You should get an error when you try to add a variable that is already set in the page. See attached design document.
Created attachment 2389 [details] Design - Validating input
This is addressed by the fix submitted for bug 7231
Also appears in 1.8._M3.RC1, commit: 40d80f9e019118ac7bcd268f21e350bc154a4a63 Cheers, Ionut C
Verified.