-
Notifications
You must be signed in to change notification settings - Fork 407
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
#5698 Fix a bug when editing a 1 week ban, duration resetting to 1 day #5702
base: master
Are you sure you want to change the base?
Conversation
…ctable durations it would reset to the first selection(which was 1 day)
This doesn't actually fix the problem with one-week bans, see #5698 (comment). There are also a lot of random formatting changes here that don't relate to the issue. I don't think anyone is editing 11-year-old bans to warrant such a bandaid for them. |
…rom selectable durations it would reset to the first selection(which was 1 day)" This reverts commit c0be35b.
…ostgres silently transforms week intervals into day intervals, so when we save a P1W interval we get a P7D, which then gets reset(since it doesn't exist in selectable duration list) to the default value in ban edit page
It seems postgres doesn't support saving week intervals. Also on a side note. Lines 79 to 80 in fe73bca
|
For now changed to 7 days for consistency's sake. If it was an oversight, I think it's best to change label and |
If the label is 7 days why are you doing |
I thought about that, but then it would differ from Line 18 in 3d2677a
And would raise questions down the line. Like why its 7.days in one place and 1.week in the other.
This way at least its more consistent. |
Well right now there's the inconsistency of it being 1.week in the duration validator, but 7.days in the UI. It should just be 7 days everywhere. |
Changed in ban model and simplified value in view. |
When editing a ban and ban duration was different from selectable durations it would reset to the first selection(which was 1 day).
Judging from the comment, there are some bans that don't conform to current restrictions, which breaks duration selector in ban edit page.
danbooru/app/models/ban.rb
Lines 76 to 77 in fe73bca