MAPC / myschoolcommute

Walk Boston Parent Survey
http://myschoolcommute.org
GNU General Public License v3.0
2 stars 1 forks source link

Adding news schools or updating school geometries throws 500 server error (partially fixed) #77

Closed allthesignals closed 9 years ago

allthesignals commented 9 years ago

Site should continue to function when school records are inserted or geometries updated through the Django admin interface.

Tasks:

allthesignals commented 9 years ago

https://github.com/MAPC/myschoolcommute/blob/master/survey/models.py#L71 Adding default=False here seems to resolve this problem.

allthesignals commented 9 years ago

@demiurg Hi Pavel - after pulling in code changes and setting a default value, I'm now seeing:

TypeError at /en/admin/survey/school/add/
int() argument must be a string or a number, not 'NoneType'

When adding new schools locally. In production, adding schools still throws a server error (500). Any updates for this issue on your front?

Thanks!

allthesignals commented 9 years ago

Hi @demiurg, Any updates on this issue? Thanks!

demiurg commented 9 years ago

Not yet, I will look at it today.

demiurg commented 9 years ago

Well, it looked like default wasn't added, maybe it got lost in merge. Can you try testing and pushing, to see if there is still any error?

allthesignals commented 9 years ago

@demiurg That's right - the default wasn't added. I tested it and it still produces an error.

On Wed, Mar 18, 2015 at 1:10 PM, Pavel notifications@github.com wrote:

Well, it looked like default wasn't added, maybe it got lost in merge. Can you try testing and pushing, to see if there is still any error?

— Reply to this email directly or view it on GitHub https://github.com/MAPC/myschoolcommute/issues/77#issuecomment-83061210.

Matt Gardner M.S. Urban and Regional Policy Candidate School of Public Policy and Urban Affairs Northeastern University

allthesignals commented 9 years ago

@demiurg I went ahead and pushed the code that includes default=False on the School model, which, like I said, still produces the TypeError. Let me know how I can help.

Thank you!

demiurg commented 9 years ago

Ok, I actually added default to wrong field, fixed now, and sheds were not generating, which they do now. Just tested and works, can you try again?

allthesignals commented 9 years ago

@demiurg Great - thanks, Pavel. I pulled and tested, and I'm seeing an SRID error, which is related to my local database. I know I was struggling with this problem earlier, so I think it's unrelated because it's trying the shed generation.

GetProj4StringSPI: Cannot find SRID (900914) in spatial_ref_sys

I would say it's probably safe to pull into production if it works for you (my local copy of the database needs some work - the restoration was not perfect anyway).

demiurg commented 9 years ago

Have you tried the insert query from another issue?

allthesignals commented 9 years ago

I did. But I'll double check in the morning. Thanks!

On Wednesday, March 18, 2015, Pavel notifications@github.com wrote:

Have you tried the insert query from another issue?

— Reply to this email directly or view it on GitHub https://github.com/MAPC/myschoolcommute/issues/77#issuecomment-83160189.

Matt Gardner M.S. Urban and Regional Policy Candidate School of Public Policy and Urban Affairs Northeastern University

demiurg commented 9 years ago

Well, the error basically says the row with that srid is not in that table. Perhaps there was an error inserting because of permissions.

allthesignals commented 9 years ago

@demiurg Hi Pavel - are you able to add schools locally without error? Thanks!

demiurg commented 9 years ago

I was, added without error for me. This is pulled to production now. If a school with real data gets added, and surveys and report work, then it can be considered working.

allthesignals commented 9 years ago

Excellent. I can successfully add schools. Thanks!

On Mon, Mar 23, 2015 at 10:51 AM, Pavel notifications@github.com wrote:

I was, added without error for me. This is pulled to production now. If a school with real data gets added, and surveys and report work, then it can be considered working.

— Reply to this email directly or view it on GitHub https://github.com/MAPC/myschoolcommute/issues/77#issuecomment-85033862.

Matt Gardner M.S. Urban and Regional Policy Candidate School of Public Policy and Urban Affairs Northeastern University

allthesignals commented 9 years ago

@demiurg Hi Pavel - not sure where this fits, but it looks like there's a static join table called school_muni that crosswalks schid with muni_id. When new schools are added, their schids aren't inserted into the join table, so batch entry can't call get_intersections on the School model. Anyway, I'm not sure if you're aware of this, but it does affect how usable the site is after adding schools.

demiurg commented 9 years ago

I did not go through the uses of school, but that sounds like a good example problem. I think the spatial data would be necessary to make the spatial search work this automatically. It would be easier to make SchoolTown model be a required relationship in the admin interface, and it would require knowing this information.