~canonical-platform-qa/ubuntu-community-testing/initial-reporting

« back to all changes in this revision

Viewing changes to ubuntu_pt_community/pages/reports.py

  • Committer: Christopher Lee
  • Date: 2015-09-17 05:33:34 UTC
  • Revision ID: chris.lee@canonical.com-20150917053334-hrzcuxz5o213u2b2
Fix flake8 errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
    # slight shim over the returned data to prepare it for presention.
106
106
    sanitised_uploads = []
107
107
    for upload in all_uploads:
108
 
        upload_id = str(upload['_id'])
109
108
        upload_date = upload['uploaded'].strftime('%Y-%b-%d %H:%M:%S')
110
109
        uploader_email = upload.get('user_email') or 'Anonymous'
111
110
 
145
144
        results_json = upload['results']
146
145
        return json.loads(results_json.decode('utf-8'))
147
146
    except KeyError:
 
147
        upload_id = str(upload.get('_id'), 'No ID.')
148
148
        logger.warning(
149
149
            'Skipping document. No results or result_map available',
150
150
            upload_id,
163
163
    """
164
164
    removal_keys = upload_details['resource_map'].keys()
165
165
 
166
 
    return { k:v for k,v in upload_details['result_map'].items()
167
 
             if k not in removal_keys }
 
166
    return {k: v for k, v in upload_details['result_map'].items()
 
167
            if k not in removal_keys}