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

class FixObjectfilterFiltercriteriaAgain(ChangeDTPPacket):
    '''Add filtercriteria on 'user' to the objectfilter module.'''
    version = 1
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 10887

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

        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()
