Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Summary of the problem

When non-admin users create sub-organizations, they were incorrectly assigned as the HCB point of contact. This caused contract signing issues where the creator appeared as both the contract signee and HCB POC.

Describe your changes

Changed POC assignment logic in sub-organization creation to:

  • Use the HCB system user (bank@hackclub.com) as POC by default
  • Only use the creator as POC if they are an HCB admin

Modified files:

  • app/controllers/api/v4/events_controller.rb - API v4 sub-org creation endpoint
  • app/controllers/events_controller.rb - Web controller sub-org creation

Implementation:

# Before: Always inherited parent's POC
point_of_contact_id: parent_event.point_of_contact_id

# After: Conditional based on admin status
poc_id = current_user.admin? ? current_user.id : User.system_user.id
point_of_contact_id: poc_id
Original prompt

This section details on the original issue you should resolve

<issue_title>[Sub-Organizations] Fix point-of-contact on HCB's end</issue_title>
<issue_description>> can we set it so that suborgs dont need a contract signer for certain hq things? we are running into the issue hcb is thinking the person inviting/creating stuff for people is an hcb admin, so reem got assigned as both the contract signee AND hcb PoC for her contract. same thing with dev inviting augie to a event suborg, it required Dev to sign off as the HCB PoC. if not could we default it to be like if the user isnt an hcb admin, it defaults to the HCB PoC being bank@?

https://hackclub.slack.com/archives/C026RKHLPNJ/p1765225576537719</issue_description>

<agent_instructions>Please switch the point of contact for new sub-organizations to hcb@hackclub.com unless the person creating it is an admin</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 9, 2025
Copilot AI and others added 2 commits December 9, 2025 01:08
…ess creator is admin

Co-authored-by: YodaLightsabr <76178582+YodaLightsabr@users.noreply.github.com>
Co-authored-by: YodaLightsabr <76178582+YodaLightsabr@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix point-of-contact assignment for sub-organizations Fix point-of-contact assignment for sub-organizations Dec 9, 2025
Copilot AI requested a review from YodaLightsabr December 9, 2025 01:12
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.

[Sub-Organizations] Fix point-of-contact on HCB's end

2 participants