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

Add cooldown time between blogs/comments creation #297

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jalsol
Copy link
Collaborator

@jalsol jalsol commented Apr 10, 2023

Description

Type of change: new feature

What

Adds cooldown time between the creation of two blogs or two comments.

The cooldown time can be changed by modifying the value of VNOJ_COMMENT_COOLDOWN and VNOJ_BLOG_COOLDOWN, respectively.

Why

To avoid spam.

How Has This Been Tested?

Tested manually on my local version of VNOJ.

Checklist

  • I have explained the purpose of this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the README/documentation
  • Any dependent changes have been merged and published in downstream modules
  • Informed of breaking changes, testing and migrations (if applicable).
  • Attached screenshots (if applicable).

By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.

judge/comments.py Outdated Show resolved Hide resolved
dmoj/settings.py Outdated Show resolved Hide resolved
judge/comments.py Outdated Show resolved Hide resolved
judge/views/blog.py Outdated Show resolved Hide resolved
- Cooldown time are now in seconds instead of minutes
- Each user can now comment every 60 seconds instead of 10 minutes
- This should be friendlier and more informative to users
- The time format is M:S instead of S since "179 minutes and 59 seconds"
  is more intuitive than "10799 seconds"
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