'Reset last_push when adding/changing a filter'

@staticmethod
def sync_resource_filter_onaccept(form):

    db = current.db
    s3db = current.s3db
    ttable = s3db.sync_task
    ftable = s3db.sync_resource_filter
    if isinstance(form, Row):
        filter_id = form.id
    else:
        try:
            filter_id = form.vars.id
        except:
            return
    row = db((ftable.id == filter_id)).select(ftable.id, ftable.deleted, ftable.task_id, ftable.deleted_fk, limitby=(0, 1)).first()
    if row:
        task_id = None
        if row.deleted:
            try:
                deleted_fk = json.loads(row.deleted_fk)
            except:
                return
            if ('task_id' in deleted_fk):
                task_id = deleted_fk['task_id']
        else:
            task_id = row.task_id
        if task_id:
            db((ttable.id == task_id)).update(last_push=None)
    return
