Modernize model fields: GenericIPAddressField and db_default=Now()#887
Merged
regulartim merged 1 commit intoGreedyBear-Project:developfrom Feb 26, 2026
Merged
Conversation
Contributor
Author
|
Hi @regulartim , I have completed all the changes as discussed. Could you please review the PR when you get a chance? Thank you! |
regulartim
approved these changes
Feb 26, 2026
Collaborator
regulartim
left a comment
There was a problem hiding this comment.
Looks good, thanks for your work! :)
12 tasks
cclts
pushed a commit
to cclts/GreedyBear
that referenced
this pull request
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Modernized model fields in
models.pyas suggested in #863:default=datetime.nowwithdb_default=Now()for allDateTimeFieldfields, moving defaults to the database level and fixing naive datetime usage (Django 5.0+)CharFieldwithGenericIPAddressFieldforSensor.address,TorExitNode.ip_address, andMassScanner.ip_addressblank=Falseandnull=Falsedeclarations sinceFalseis already the default in Djangotest_sensor_repository.pyto remove redundant database filter assertions for invalid IPs sinceGenericIPAddressFieldenforces IP validation at the database levelNote:
FireHolList.ip_addresswas intentionally kept asCharFieldsince it stores both plain IPs and CIDR ranges (e.g.1.2.3.4/24) which are incompatible withGenericIPAddressField.Related issues
Closes #863
Type of change
Checklist
develop.Ruff) gave 0 errors.