- Add force_insert=True to Token.save() for new objects to prevent overwriting existing tokens
- Revert generate_key method to original implementation (os.urandom + binascii)
- Update tests to work with original setUp() approach
- Remove verbose comments and unrelated changes per reviewer feedback
- Fix key collision issue that could overwrite existing tokens
- Use force_insert=True only for new token instances
- Replace os.urandom with secrets.token_hex for better security
- Add comprehensive test suite to verify fix and backward compatibility
- Ensure existing tokens can still be updated without breaking changes
* Fix test with Django 5 when pytz is available
* fix formatting
* remove original condition
Co-authored-by: Ülgen Sarıkavak <ulgens@users.noreply.github.com>
* remove trailing whitespace
* further improvements
* let's not skip the pytz test - it should always be executed when testing against Django 4
* add comment to test requirements
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
* simplify the pytz import as it should always be available
* make isort happy
---------
Co-authored-by: Ülgen Sarıkavak <ulgens@users.noreply.github.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
* Fix : Updated documentation in tutorial 5 leading to error
* Updated docs/tutorial/5-relationships-and-hyperlinked-apis.md
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
* Missing newline
---------
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
* Drop HTML line breaks on long headers
* Remove related test
* Fix flake8
---------
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
* Add failing test for `UniqueConstraint` validation with `source` attribute
* Fix `UniqueTogetherValidator` to handle fields with source attribute
* split inner sources logic out to tuple comprehension
* Start drafting release notes from 3.16 (Generated from GitHub)
* Reformat changes and split into sections
* Format GitHub PRs links for the docs
* Link new contributors in Markdown format
* Write up 3.16 announcement
* Bump version
* Add entry for removed Python 3.8 support
* Update release date to 28/03
* Minor rewording
* Add 3.16 announcement to the navbar and link to docs
* Fix typo of 'related' in tests
* Fix typo of permission_classes in coreapi test
* Fix some minor typos in docs
* Fix typos in tests
* Fix flake8 issue
* Fixed regression that tests using format still work
Error only occurred on tests which return no content and use
a renderer without charset (e.g. JSONRenderer)
* Fixed linting
* Used early return as before
* Move ret str check back to where it was
* Add test to reproduce problem with nullable fields part of a unique constraint
Ref #9378
* Simplify test case and add similar case for unique_together
* Add test for unique together in a better place
* Default nullable fields to null in unique constraints checks
* Remove redundant test and move other to more appropriate place