Developer Journal: 28 April 2020

Posted on Tue 28 April 2020 in dev-journal

Yesterday I wrote a very simple test for a delete route:

def test_delete_removes_worker_from_db(self, mock_launch):
    mock_launch.return_value = ""
    login_user(self.client,, password='password')

    workers = SiteWorker.query.all()
    self.assertEqual(len(workers), 0)

To allow that test to pass I added a delete route:

@bp.route('<int:worker_id>', methods=['DELETE'])
def delete_worker(site_id, worker_id):
    # create a provisioner command to stop, disable, and delete the current
    # worker setup on the server as well as the site_worker in the database
    site = Site.query.get(site_id)
    client = Client(
    site.launch_task("Deleting workers",

    worker = SiteWorker.query.filter_by(id=worker_id).first()

    return redirect(url_for("workers.index", site_id=site_id))

Then to tie this all together I can add a button to each of the workers on the worker index page. I may change this to use a form instead of the link but this works well for what I need right now.

<a data-action="" 
data-confirm="Are you sure you want to delete this worker?"
class="text-red-600 mt-8 ml-8" 
href="{{ url_for("workers.delete_worker",, }}">Delete

The last piece of this feature is to allow custom workers, to start this off an extra form field is necessary:

custom_worker = StringField("Advanced use only: custom worker")

Mocking up a page to help users of an app fill out speaker evaluations. These evaluations are used to determine the amount of credits a conference attendee has earned. We need to make sure that we give users an easy way to find the evaluations for the talks they attended.

Currently the evaluations are just listed with no ability to sort or filter.

Evaluation currently

While I'm in here I'm going to update the evaluation page...

Evaluation Update Comparison

To help users find the talks for the evaluations they have not completed at the time of the talk - we introduce filters. Selecting a talk will begin by choosing the day the talk occured and from there additional filters are used to help fine tune the search.

Evaluation Filter