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
Users changing publication dates for existing posts causes a constraint violation. #56
Comments
I'm guessing this has something to do with my altering the datestamp so that this particular post counted for the next week, after which I decided I didn't actually care. Presumably the script is supposed to identify the date change and update the timestamp field when that happens, but it looks like for some reason it tried to create a new row. Page_url would be the same for both rows, and perhaps blog_id would as well (not sure how that's generated), hence the unique constraint violation. |
Relevant snippet of code is here: https://github.com/zenhack/iron-blogger2/blob/master/ironblogger/model.py#L146 You're impression is spot on. I should tweak that code such that it can't cause a constraint violation. For the immediate term, I'll just delete the original post from the db and let it re-fetch it. |
@shaunagm, I did the manual db tweak I mentioned, and your posts are updating again. I'm leaving this issue open, since user input triggering a constraint violation is unambiguously a bug. It's not 100% obvious what the right solution is; I think when I wrote the code I was thinking in terms of tweaking the date on an existing post being "cheating", and something that really ought to be run past others. This is probably true, but I don't really think it's worth having that be part of the software's threat model. This is supposed to be a friendly activity, and there are easier ways to game the system anyway. My inclination is to just remove the first half of that big and clause, so there's no requirement for the publication date at all. Does that sound sensible? //cc @hlieberman @jywarren |
I am happy to never tweak a date again - it is really just a dollar, after all - but I'm also fine with giving bloggers the benefit of the doubt and not checking to see if they're cheating. |
I think I'm going to change it such that it allows adjusting dates; it seems like the simplest thing to do. I'm changing the title for this issue. |
I haven't dug into this yet, but @shaunagm's posts aren't being pulled into correctly this is showing up, and this is showing up in the logs:
The text was updated successfully, but these errors were encountered: