Skip to content

[Bug 701385] R? "Update" questions only when answered.#725

Closed
mythmon wants to merge 2 commits intomozilla:masterfrom
mythmon:bug-701385
Closed

[Bug 701385] R? "Update" questions only when answered.#725
mythmon wants to merge 2 commits intomozilla:masterfrom
mythmon:bug-701385

Conversation

@mythmon
Copy link
Contributor

@mythmon mythmon commented Jul 19, 2012

Previously questions would have the updated field set to
datetime.now() when ever Question.save() was called, unless
no_update=True was specified. This caused it to move to the top of
question listings, which is not desired. The only time a question should
be moved to the top is when it is answered, so this changes the default
behvior to not update the updated field unless save recieves a
parameter update=True.

Tests have been added/modified to assure that this is the case, and I
looked over existing code to make sure anything that interacted with
Question.updated was adapted.

Previously questions would have the `updated` field set to
`datetime.now()` when ever `Question.save()` was called, unless
`no_update=True` was specified. This caused it to move to the top of
question listings, which is not desired. The only time a question should
be moved to the top is when it is answered, so this changes the default
behvior to *not* update the `updated` field unless `save` recieves a
parameter `update=True`.

Tests have been added/modified to assure that this is the case, and I
looked over existing code to make sure anything that interacted with
`Question.updated` was adapted.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... just curious as to why you didn't just change the args for save() from no_update to update? i think it's probably a good idea for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure exactly how much change to APIs I should make, so I wasn't sure if I should change the name of the argument here too. I wanted to get feed back first, but since you said something, I will go ahead and change it.

@mythmon
Copy link
Contributor Author

mythmon commented Jul 20, 2012

Added some code.

@willkg
Copy link
Member

willkg commented Jul 20, 2012

Sweet--the code looks fine, but I want to run the tests again and can't do that for another 20 minutes or so. I'll let you know what happens.

@willkg
Copy link
Member

willkg commented Jul 20, 2012

Tests pass. r+!

@mythmon mythmon closed this Jul 20, 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.

3 participants