def del_jobid(job_id):
    """Delete job_id from job_ids column in user table"""
    with crackq.app.app_context():
        for user in User.query.all():
            if user.job_ids and job_id in user.job_ids:
                jobs = json.loads(user.job_ids)
                logger.debug('Registered jobs: {}'.format(jobs))
                if isinstance(jobs, list):
                    logger.debug('Unregistering job_id: {}'.format(job_id))
                    if job_id in jobs:
                        jobs.remove(job_id)
                        user.job_ids = json.dumps(jobs)
                        db.session.commit()
                        logger.debug('user.job_ids: {}'.format((user.job_ids)))
                        return True
                else:
                    logger.error('Error removing job_id')
            else:
                logger.debug('Job ID not registered with user')
        return False
Delete job_id from job_ids column in user table
crackq/cq_api.py