def clean_attachment_history(self):
        history = self.cleaned_data['attachment_history']

        if (history is not None and
            not self.review_request.file_attachment_histories.filter(
                pk=history.pk).exists()):
            raise forms.ValidationError(
                'The FileAttachmentHistory provided is not part of this '
                'review request.')

        return history
Can optionally override to handle signals
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/attachments/forms.py/UploadFileForm.clean_attachment_history--crossover with--dataset/ETHPy150Open Anaconda-Platform/chalmers/chalmers/program/base.py/ProgramBase.handle_signals