Skip to content

refactor : honeypot creation and enforce case-insensitive uniqueness . Closes #689#693

Merged
regulartim merged 4 commits intointelowlproject:developfrom
drona-gyawali:refactor/normalize_name
Jan 13, 2026
Merged

refactor : honeypot creation and enforce case-insensitive uniqueness . Closes #689#693
regulartim merged 4 commits intointelowlproject:developfrom
drona-gyawali:refactor/normalize_name

Conversation

@drona-gyawali
Copy link
Copy Markdown
Contributor

@drona-gyawali drona-gyawali commented Jan 9, 2026

Description

This PR addresses issues with honeypot creation and ensures case-insensitive uniqueness:

  • Added a unique constraint on GeneralHoneypot.name (case-insensitive) at the database level.
  • Updated the create_honeypot method to handle IntegrityError gracefully.
  • Used get_or_create in test cases to avoid duplicate key errors and ensure reliable test setup.
  • Added and improved test cases for create_honeypot.

Related issues

closes #689

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist

  • I have read and understood the rules about how to Contribute to this project.
  • The pull request is for the branch develop.
  • I have added documentation of the new features.
  • Linters (Black, Flake, Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved. All the tests (new and old ones) gave 0 errors.
  • If changes were made to an existing model/serializer/view, the docs were updated and regenerated (check CONTRIBUTE.md).
  • If the GUI has been modified:
    • I have a provided a screenshot of the result in the PR.
    • I have created new frontend tests for the new component or updated existing ones.

Important Rules

  • If you miss to compile the Checklist properly, your PR won't be reviewed by the maintainers.
  • If your changes decrease the overall tests coverage (you will know after the Codecov CI job is done), you should add the required tests to fix the problem
  • Everytime you make changes to the PR and you think the work is done, you should explicitly ask for a review. After being reviewed and received a "change request", you should explicitly ask for a review again once you have made the requested changes.

@drona-gyawali drona-gyawali marked this pull request as ready for review January 9, 2026 18:19
@regulartim
Copy link
Copy Markdown
Collaborator

Hey @drona-gyawali ! :) Independent of the review I wanted to ask you why you think that this is a breaking change? What exactly will break, when we merge this?

Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some problems with the current version of the code. Also, could you add a test case that tests the unique constraint?

@drona-gyawali
Copy link
Copy Markdown
Contributor Author

Hey @drona-gyawali ! :) Independent of the review I wanted to ask you why you think that this is a breaking change? What exactly will break, when we merge this?

Thanks for pointing that out :)
You’re right this is not actually a breaking change. I mistakenly checked the breaking-change box.

@regulartim regulartim merged commit 6bb224b into intelowlproject:develop Jan 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants