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

Remove reply button on old comments #2009

Merged
merged 1 commit into from
Oct 31, 2022
Merged

Remove reply button on old comments #2009

merged 1 commit into from
Oct 31, 2022

Conversation

int-y1
Copy link
Contributor

@int-y1 int-y1 commented Oct 11, 2022

fixes #823

  • remove reply button when comment is too old and user doesn't have judge.change_comment.
  • users can now reply to their own comment (previously, the backend allowed it, but the frontend didn't show the reply button)

Capture

@Riolku
Copy link
Contributor

Riolku commented Oct 12, 2022

Do other people have opinions on this being a pure UI change?

@quantum5
Copy link
Member

It looks to be a trivial change in the backend, so let's do it instead of letting people deliberately necropost to "show their 1337 h4x0r skills".

@int-y1 int-y1 force-pushed the no-necropost branch 2 times, most recently from 0cf694f to 3b97d1c Compare October 12, 2022 07:41
@int-y1
Copy link
Contributor Author

int-y1 commented Oct 12, 2022

It looks to be a trivial change in the backend, so let's do it instead of letting people deliberately necropost to "show their 1337 h4x0r skills".

done

dmoj/settings.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Riolku Riolku left a comment

Choose a reason for hiding this comment

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

Overall looks fine.

Comment on lines +87 to +88
if not (self.request.user.has_perm('judge.change_comment') or
parent_comment.time > timezone.now() - settings.DMOJ_COMMENT_REPLY_TIMEFRAME):
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be the only one, but I feel like

if timezone.now() - parent_comment.time > settings.DMOJ_COMMENT_REPLY_TIMEFRAME and not self.request.user.has_perm('judge.change_comment'):

Is the more readable way of writing this.

templates/comments/list.html Show resolved Hide resolved
judge/comments.py Outdated Show resolved Hide resolved
Copy link
Member

@kiritofeng kiritofeng left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@Xyene Xyene left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Xyene Xyene merged commit 765c503 into DMOJ:master Oct 31, 2022
@int-y1 int-y1 deleted the no-necropost branch October 31, 2022 03:26
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.

Block commenting on old threads
5 participants