samvozza / IAPTAssessment

Other
1 stars 0 forks source link

Server error appears again when adding an object. #76

Closed Mingzhao91 closed 8 years ago

Mingzhao91 commented 8 years ago

If I add an object with this address: http://127.0.0.1:8000/IAPTAssessmentmaster7/object/create#, the new object is successfully added to the collection. However, when adding an object with this address: http://127.0.0.1:8000/IAPTAssessmentmaster7/object/create?collection=1, I have a server error on the screen but there is on other information telling me what goes wrong. Could you guys help me with this issue? Thank you.

arandomoracle commented 8 years ago

The link above is working fine for me. :(

When you run web2py, there should be two windows: the command line/terminal one and the server setup one. Is anything appearing in the command line/terminal one?

Mingzhao91 commented 8 years ago

The server error occurs when the form is submitted for the second link. Google chrome only shows me the server setup window. There is no command line/terminal window for me and I am not sure how could I find it. The error link is: http://127.0.0.1:8000/IAPTAssessmentmaster8/object/create?collection=1#

arandomoracle commented 8 years ago

OK. Think I've got it. Because the collection is being passed as both a url parameter and as a form POST parameter, the two were conflicting. This should be fixed by 4d9b27d.

(Specifically, if web2py finds two params with the same name it builds them into a list containing all the values, meaning that request.args['collection'] became ['1', '1'] - a list containing the two collection ids. Obviously this mucked up the database lookup.)

Not sure why the error handling disappeared though - I'll take a closer look at this.