django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

Allow custom throttle to provide a custom detail

Open sevdog opened this issue 4 years ago • 6 comments

Description

This PR adds a new feature to APIView when using a throttle class. Now the .wait() method can return a tuple of two elements:

  1. duration (which could be None): which behaves as previous return value
  2. detail: a string to be used as detail param for Throttled exception

This allows users to define custom throttle message when extending BaseThtottle.

sevdog avatar Mar 04 '21 10:03 sevdog

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 29 '22 23:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 02 '23 19:04 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 18 '23 07:06 stale[bot]

i'm not sure why the CI tests didn't trigger? can you pull from main branch please?

auvipy avatar Jun 18 '23 07:06 auvipy

Now it was triggered but tests failed for something which does not seems related to this PR 🤔

sevdog avatar Jun 20 '23 13:06 sevdog

yes the tests are fine for this PR. the failures are unrelated

auvipy avatar Jun 20 '23 14:06 auvipy