Skip to content

Commit

Permalink
Merge pull request OpenG2P#247 from RamakrishnaVellala/17.0-develop-main
Browse files Browse the repository at this point in the history
G2p-2512 bug fix
  • Loading branch information
shibu-narayanan authored Jun 18, 2024
2 parents b1f5976 + 473edb2 commit 12883d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion g2p_programs/wizard/assign_to_program_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def default_get(self, fields):
required=True,
)

# ruff: noqa: C901
def assign_registrant(self):
if self.env.context.get("active_ids"):
partner_ids = self.env.context.get("active_ids")
Expand Down Expand Up @@ -90,12 +91,19 @@ def assign_registrant(self):
)

if len(partner_ids) == 1:
if rec.disabled:
if rec.disabled and rec.is_group:
message = _("Disabled group can't be added to the program.") % {
"registrant": rec.name,
"program": self.program_id.name,
}
kind = "danger"
elif rec.disabled and not rec.is_group:
message = _("Disabled individaul can't be added to the program.") % {
"registrant": rec.name,
"program": self.program_id.name,
}
kind = "danger"

elif ig_ctr and not rec.disabled:
message = _("%(registrant)s was already in the Program %(program)s") % {
"registrant": rec.name,
Expand Down

0 comments on commit 12883d2

Please sign in to comment.