from console_base.models import LCTextField


class KeyField(LCTextField):
    def get_prep_value(self, value: str) -> str:
        """
        API calls can come from Windows machines,
        so convert carriage returns to new lines.
        """
        return value.strip().replace('\r\n', '\n')
