# -*- coding: utf-8 -*-
from ppms.migration.packet import *

class FixObjectfilterFiltercriteria(ChangeDTPPacket):
    '''Remove filtercriteria on 'user' of the objectfilter module.'''
    version = 1
    done_after_success = True
    run_on_startup = False
    category = PacketCategory.CATEGORY_OPTIONAL
    wi_number = 8994

    def fix(self, runner):
        OLD_VAL = '@1'
        NEW_VAL = ''

        record = self.get_record(411, ['042557', 143772], [1714])
        if not self.change_value(record, 'filter_from', OLD_VAL, NEW_VAL):
            return self.fail()

        return self.success()
