@classmethod
    def assignment_onaccept(cls, form):
        """
            Onaccept callback for work assignments

            @param form: the FORM
        """

        try:
            formvars = form.vars
        except AttributeError:
            return

        db = current.db
        atable = current.s3db.work_assignment

        if "job_id" not in formvars:
            if "id" not in formvars:
                return
            record_id = formvars.id
            row = db(atable.id == record_id).select(atable.job_id,
                                                    limitby = (0, 1)).first()
            if not row:
                return
            job_id = row.job_id
        else:
            job_id = formvars.job_id

        if job_id:
            cls.update_workers_assigned(job_id)

        return

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3db/work.py/WorkJobModel.assignment_onaccept/original