def METHOD_NAME(self, ids):
    ids = list(set(ids))
    validate_attachments_count(ids, self.context["settings"])
    attachments = self.get_initial_attachments()
    new_attachments = self.get_new_attachments(ids)
    if not attachments and not new_attachments:
        return []  # no attachments
    # clean existing attachments
    for attachment in attachments:
        if attachment.pk in ids:
            self.final_attachments.append(attachment)
        else:
            if attachment.acl["can_delete"]:
                self.update_attachments = True
                self.removed_attachments.append(attachment)
            else:
                message = pgettext(
                    "posting api",
                    'You don\'t have permission to remove "%(attachment)s" attachment.',
                )
                raise serializers.ValidationError(
                    message % {"attachment": attachment.filename}
                )
    if new_attachments:
        self.update_attachments = True
        self.final_attachments += new_attachments
        self.final_attachments.sort(key=lambda a: a.pk, reverse=True)