from orm_signal_handler import orm_signal_handler
from specify.models import Specifyuser
from exceptions import BusinessRuleException


@orm_signal_handler('pre_save', 'Groupperson')
def agent_cannot_be_in_self(groupperson):
    if groupperson.member_id == groupperson.group_id:
        raise BusinessRuleException('a group cannot be made a member of itself'
            )

dfab552574e8f4531b2299b79b5d05fbf6405737
<mask token>

<mask token>


@orm_signal_handler('pre_save', 'Groupperson')
def agent_cannot_be_in_self(groupperson):
    if groupperson.member_id == groupperson.group_id:
        raise BusinessRuleException('a group cannot be made a member of itself'
            )

from orm_signal_handler import orm_signal_handler
from specify.models import Specifyuser
from exceptions import BusinessRuleException


@orm_signal_handler('pre_save', 'Groupperson')
def agent_cannot_be_in_self(groupperson):
    if groupperson.member_id == groupperson.group_id:
        raise BusinessRuleException('a group cannot be made a member of itself'
            )
