Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix saving a portfolio entry (fixes issue #748) #54

Merged
merged 1 commit into from Aug 12, 2012
Merged

Fix saving a portfolio entry (fixes issue #748) #54

merged 1 commit into from Aug 12, 2012

Conversation

e2jk
Copy link

@e2jk e2jk commented Aug 12, 2012

When creating a new project from /+portfolio/editor/, the code was trying to get the pk of the project by getting it from request.POST['portfolio_entry__pk']. However for new projects there is no such element, so a MultiValueDictKeyError exception was launched, and since it was not catched it resulted in a 500 error.

My change uses the .get function of the request.POST object to retrieve that value, and gives it the value of undefined if it's not present. The next line already checks if pk == 'undefined':, so now there is no more exception being triggered, and the new project can be created.

This fixes https://openhatch.org/bugs/issue748

@paulproteus
Copy link
Contributor

Emilien, this is a great patch; thank you for taking a look.

If possible, please send a license notice to the mailing list as per this link: http://openhatch.readthedocs.org/en/latest/contributor/handling_patches.html#permit-us-to-share-your-work

But since this is such a small fix, I'll merge it as-is!

paulproteus added a commit that referenced this pull request Aug 12, 2012
@paulproteus paulproteus merged commit acc2b15 into openhatch:master Aug 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants