#12325 closed (fixed)
Allow value of zero for moderate_after and close_after
Reported by: | zhigang | Owned by: | Gabriel Hurley |
---|---|---|---|
Component: | contrib.comments | Version: | 1.1 |
Severity: | Keywords: | moderation, sprintnov13 | |
Cc: | james@…, andrew@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the current implement, if we want all comments go to approval queue just after a entry is published, you should assign moderate_after a value < 0. But moderate_after = 0 makes more sense. This patch allows this.
Attachments (2)
Change History (11)
by , 15 years ago
Attachment: | django-comments-moderation-allow-zero-moderate_after.patch added |
---|
comment:1 by , 15 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Cc: | added |
---|
comment:3 by , 14 years ago
The comment app does have tests; for historical reasons, they're not under contrib.comments; they're in the regressiontests directory, under comments_tests.
comment:4 by , 14 years ago
Ah, ok, I see them now. Didn't think to look there for them, thanks for the pointer.
comment:5 by , 14 years ago
Needs documentation: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Summary: | [PATCH]Allow zero moderate_after time → Allow zero moderate_after time |
I'll finish off this patch with tests and a small note about allowed values in the docs... claiming it so I don't forget.
comment:6 by , 14 years ago
milestone: | → 1.3 |
---|---|
Needs documentation: | unset |
Needs tests: | unset |
Summary: | Allow zero moderate_after time → Allow value of zero for moderate_after and close_after |
Added a new patch which allows 0 as a valid value for both close_after
and moderate_after
. Includes docs and tests. Passes test suite.
comment:7 by , 14 years ago
Keywords: | sprintnov13 added |
---|
This patch applies cleanly and all tests pass.
comment:8 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Where should tests for this patch go, and what approach should be used for them?
The comments app currently doesn't have *any* tests, and I think this is understandable (not good, just understandable), because the various aspects of the app depend on subclassing (for custom moderation) and other models (for normal commenting).
At any rate, an alternative workaround to using a negative number is to specify a very small number, such as one second:
Not as clean as "0", but it's effectively the same and will work until this patch is checked in.