Skip to content

Validation for CIDR is not correct #19

@tinyx

Description

@tinyx

I've received an error when I tried to save a CIDR like '64.34.117.2/20', and I got a database error, says the CIDR is not correct.
Then I check the source code of this plug-in, and found the piece of code here:

try:
    return IPNetwork(value)
except (AddrFormatError, TypeError), e:
    raise ValidationError(str(e))

I highly doubt that this is doing the right thing, it only check if we can convert the IP value to a valid IPNetwork object, instead of a valid CIDR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions