'Task form validation'

@staticmethod
def project_task_onvalidation(form):

    vars = form.vars
    if ((str(vars.status) == '3') and (not vars.pe_id)):
        form.errors.pe_id = (current.T("Status    'assigned'    requires    the    %(fieldname)s    to    not    be    blank") % dict(fieldname=current.db.project_task.pe_id.label))
    elif (vars.pe_id and (str(vars.status) == '2')):
        vars.status = 3
