<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clean(self, value):
 """Raises a ValidationError if the card is not valid and stashes card type."""

        if value:
            value = value.replace('-', '').replace(' ', '')
            self.card_type = verify_credit_card(value)
            if self.card_type is None:
                raise forms.ValidationError("Invalid credit card number.")
        return value