Skip to content

[BUG] Enforce mutual exclusivity for contact person and organisation#714

Open
rishavtarway wants to merge 2 commits intoaiondemand:developfrom
rishavtarway:fix/518-contact-mutual-exclusivity
Open

[BUG] Enforce mutual exclusivity for contact person and organisation#714
rishavtarway wants to merge 2 commits intoaiondemand:developfrom
rishavtarway:fix/518-contact-mutual-exclusivity

Conversation

@rishavtarway
Copy link

Change(s)

Change Type: Fixed
Change Category: Internal
Changelog Entry: Add API-level validation to reject Contact payloads that set both person and organisation.

How to Test

  • python -m pytest src/tests/routers/resource_routers/test_router_contact.py -k person_and_organisation_both_specified -q
  • python -m pytest src/tests/routers/resource_routers/test_router_contact.py -q

Checklist

  • Tests have been added or updated to reflect the changes, or their absence is explicitly explained.
  • Documentation has been added or updated to reflect the changes, or their absence is explicitly explained.
  • A self-review has been conducted checking:
    • No unintended changes have been committed.
    • The changes in isolation seem reasonable.
    • Anything that may be odd or unintuitive is provided with a GitHub comment explaining it.
  • All CI checks pass before pinging a reviewer, or provide an explanation if they do not.
  • The PR title matches the changelog entry's one-line description.

Notes:

Related Issues

Refs #518

@rishavtarway rishavtarway marked this pull request as ready for review March 3, 2026 11:43
@rishavtarway
Copy link
Author

Local contact-router tests pass (test_router_contact.py), and the PR scope is limited to application-level validation plus regression test re-enable for #518 .

@rishavtarway
Copy link
Author

rishavtarway commented Mar 11, 2026

Quick status update on this PR:

  • Scope is limited to application-level mutual-exclusivity validation for Contact (person vs organisation) plus regression test re-enable/update.
  • Local checks run:
    • python -m pytest src/tests/routers/resource_routers/test_router_contact.py -k person_and_organisation_both_specified -q
    • python -m pytest src/tests/routers/resource_routers/test_router_contact.py -q
  • Current behavior now returns 400 with clear message when both fields are set, matching expected API behavior.

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.

1 participant