'Ensures the doc_file or the doc_url field is populated.'

def clean(self):

    cleaned_data = super(DocumentReplaceForm, self).clean()
    doc_file = self.cleaned_data.get('doc_file')
    doc_url = self.cleaned_data.get('doc_url')
    if ((not doc_file) and (not doc_url)):
        raise forms.ValidationError(_('Document    must    be    a    file    or    url.'))
    if (doc_file and doc_url):
        raise forms.ValidationError(_('A    document    cannot    have    both    a    file    and    a    url.'))
    return cleaned_data
