<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def attachment_state(self):
 """ Get the attachment state. """

        state = None
        if self.attach_data:
            state = self.attach_data.status
        return state