diff options
author | Dan McGee <dan@archlinux.org> | 2013-04-16 22:12:01 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-04-16 22:12:01 -0500 |
commit | b7b24740640e24883cd17fd683e1d465fbb343f8 (patch) | |
tree | 0a8a4fdf23f3a3b7f0551e859c36c23e3afe212f /mirrors/utils.py | |
parent | 31d39e75eea7fb6cdf3bb8bfd8b490d45de04ee9 (diff) |
Various minor code cleanups and fixesrelease_2013-04-16
Most of these were suggested by PyCharm, and include everything from
little syntax issues and other bad smells to dead or bad code.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/utils.py')
-rw-r--r-- | mirrors/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mirrors/utils.py b/mirrors/utils.py index 5a8bbf5d..531cf005 100644 --- a/mirrors/utils.py +++ b/mirrors/utils.py @@ -1,13 +1,13 @@ from datetime import timedelta from django.db import connection -from django.db.models import Avg, Count, Max, Min, StdDev +from django.db.models import Count, Max, Min from django.utils.dateparse import parse_datetime from django.utils.timezone import now from django_countries.fields import Country from main.utils import cache_function, database_vendor -from .models import MirrorLog, MirrorProtocol, MirrorUrl +from .models import MirrorLog, MirrorUrl DEFAULT_CUTOFF = timedelta(hours=24) @@ -165,7 +165,7 @@ def get_mirror_errors(cutoff=DEFAULT_CUTOFF, mirror_id=None): ).order_by('-last_occurred', '-error_count') if mirror_id: - urls = urls.filter(mirror_id=mirror_id) + errors = errors.filter(url__mirror_id=mirror_id) errors = list(errors) for err in errors: |