diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-11-28 19:57:27 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-11-28 19:57:27 -0500 |
commit | dbb508b7222081b523ce3e0bd2b69f5fea6c7050 (patch) | |
tree | f5f3a97b9465504ed9e7633a0c385669b7463d3c /mirrors | |
parent | fd788c5fcf9009540ad14a869dcebdfd30fb9d6f (diff) | |
parent | b2b6c78e3179cef66cd4e9dcea7f9003f409ce8b (diff) |
Merge tag 'release_2013-11-25' into archweb-generic
Django 1.6 upgrade and other changes
Conflicts:
templates/news/list.html
templates/public/index.html
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/admin.py | 6 | ||||
-rw-r--r-- | mirrors/management/commands/mirrorcheck.py | 2 | ||||
-rw-r--r-- | mirrors/utils.py | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/mirrors/admin.py b/mirrors/admin.py index d0f2f475..e35d9ce7 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -10,6 +10,7 @@ from .models import (Mirror, MirrorProtocol, MirrorUrl, MirrorRsync, class MirrorUrlForm(forms.ModelForm): class Meta: model = MirrorUrl + fields = ('url', 'country', 'active') def clean_url(self): # is this a valid-looking URL? @@ -39,6 +40,7 @@ class MirrorUrlInlineAdmin(admin.TabularInline): class MirrorRsyncForm(forms.ModelForm): class Meta: model = MirrorRsync + fields = ('ip',) class MirrorRsyncInlineAdmin(admin.TabularInline): @@ -50,6 +52,10 @@ class MirrorRsyncInlineAdmin(admin.TabularInline): class MirrorAdminForm(forms.ModelForm): class Meta: model = Mirror + fields = ('name', 'tier', 'upstream', 'admin_email', 'alternate_email', + 'public', 'active', 'isos', 'rsync_user', 'rsync_password', + 'notes') + upstream = forms.ModelChoiceField( queryset=Mirror.objects.filter(tier__gte=0, tier__lte=1), required=False) diff --git a/mirrors/management/commands/mirrorcheck.py b/mirrors/management/commands/mirrorcheck.py index 3f026c36..e48aa42e 100644 --- a/mirrors/management/commands/mirrorcheck.py +++ b/mirrors/management/commands/mirrorcheck.py @@ -241,7 +241,7 @@ class MirrorCheckPool(object): thread.daemon = True self.threads.append(thread) - @transaction.commit_on_success + @transaction.atomic def run(self): logger.debug("starting threads") for thread in self.threads: diff --git a/mirrors/utils.py b/mirrors/utils.py index bba8e36b..633731a7 100644 --- a/mirrors/utils.py +++ b/mirrors/utils.py @@ -35,7 +35,7 @@ def status_data(cutoff_time, mirror_id=None): sql = """ SELECT l.url_id, u.mirror_id, COUNT(l.id) AS check_count, - COUNT(l.duration) AS success_count, + COUNT(l.last_sync) AS success_count, MAX(l.last_sync) AS last_sync, MAX(l.check_time) AS last_check, AVG(l.duration) AS duration_avg, @@ -51,7 +51,7 @@ GROUP BY l.url_id, u.mirror_id sql = """ SELECT l.url_id, u.mirror_id, COUNT(l.id) AS check_count, - COUNT(l.duration) AS success_count, + COUNT(l.last_sync) AS success_count, MAX(l.last_sync) AS last_sync, MAX(l.check_time) AS last_check, AVG(l.duration) AS duration_avg, |