Ejemplo n.º 1
0
    def update(self, member: Member, data: dict):
        # Update Person data
        super().update(member, data)

        # Update Member data
        if 'medical_certificate' in data:
            member.medical_certificate = data['medical_certificate']

        self._database_session.merge(member)
        self._database_session.flush()

        return member
Ejemplo n.º 2
0
 def update(self, member: Member, data: dict):
     if 'firstname' in data:
         member.firstname = data['firstname']
     if 'lastname' in data:
         member.lastname = data['lastname']
     if 'email' in data:
         member.email = data['email']
     if 'medical_certificate' in data:
         member.medical_certificate = data['medical_certificate']
     try:
         self._database_session.merge(member)
         self._database_session.flush()
     except IntegrityError:
         raise Error("Error data may be malformed")
     return member