<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def detect_uniqueness_error(self, exc):
 """ Parse error, and if it describes any violations of a uniqueness constraint, return the corresponding fields, else None """

        pattern = r"(\w+) with this (\w+) already exists"

        fields = []
        if isinstance(exc, IntegrityError):
            return self._detect_integrity_error(exc)
        assert isinstance(exc, ValidationError), TypeError

        for name, err in exc.error_dict.items():
            if re.search(pattern, str(err)):
                fields.append(name)
        return fields or None