Correcting indent to stop it complaining on a push to develop

Still correcting merge confilct, this is more preventative as i just resolved this conflict between my branch and develop, on develop.

The problem still exisited here so jsut fixing it now

Refs #8031
Refactored some repeated code

I introduced some repeated code, so i've condensed and refactored it into it's own method.

Refs #8031
Merge branch 'feature/8031_workspace_in_sample_log_name' into develop