-
Notifications
You must be signed in to change notification settings - Fork 923
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 user block api call #4301
base: master
Are you sure you want to change the base?
Add user block api call #4301
Conversation
d1e66e6
to
f65029c
Compare
f65029c
to
9767fd9
Compare
33c491d
to
62db2c8
Compare
083162b
to
68ebbad
Compare
26b6145
to
f09b537
Compare
f09b537
to
0d891ae
Compare
Updated to align with #5155. |
a7a96a1
to
da15d99
Compare
raise OSM::APIBadUserInput, "No period was given" unless params[:period] | ||
|
||
period = Integer(params[:period], :exception => false) | ||
raise OSM::APIBadUserInput, "Period should be a number of hours" unless period |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if the permitted values should be more in line with user_block_periods in settings.yml:
# Periods (in hours) which are allowed for user blocks
user_block_periods: [0, 1, 3, 6, 12, 24, 48, 96, 168, 336, 731, 4383, 8766, 87660]
Are values not explicitly mentioned there ok for the UI, or would they cause issues in dropdown lists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block durations are not stored directly. Dropdowns show the closes value to the remaining time: #5011
da15d99
to
8cfb274
Compare
8cfb274
to
d4c88a3
Compare
This lets block users by id, which helps in case they frequently change their username.