diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-10-02 20:43:56 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-10-02 20:43:56 -0400 |
commit | 355087ebe2e3fbd5f860e4655888a89d9df52e34 (patch) | |
tree | d01f6206a2f2d054d4d1931019f5ba2a248fe982 /mirrors/admin.py | |
parent | ae785343076fd1fe8b89f69ca370f7fcd0cdcbd4 (diff) | |
parent | ea00a099dffd7157c93af54b5817734348d2bbc6 (diff) |
Merge branch 'archweb-generic' into master-nomake
Conflicts:
templates/public/download.html
templates/public/feeds.html
templates/public/index.html
urls.py
Diffstat (limited to 'mirrors/admin.py')
-rw-r--r-- | mirrors/admin.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mirrors/admin.py b/mirrors/admin.py index 17365486..d5c89c2a 100644 --- a/mirrors/admin.py +++ b/mirrors/admin.py @@ -1,3 +1,4 @@ +from datetime import datetime from urlparse import urlparse, urlunsplit from django import forms @@ -67,12 +68,19 @@ class MirrorAdmin(admin.ModelAdmin): 'isos', 'admin_email', 'alternate_email') list_filter = ('tier', 'active', 'public') search_fields = ('name', 'admin_email', 'alternate_email') - readonly_fields = ('created',) + readonly_fields = ('created', 'last_modified') inlines = [ MirrorUrlInlineAdmin, MirrorRsyncInlineAdmin, ] + def save_model(self, request, obj, form, change): + if '~~~' in obj.notes: + date = datetime.utcnow().strftime('%Y-%m-%d') + usertext = request.user.get_full_name() + obj.notes = obj.notes.replace('~~~', '%s (%s)' % (date, usertext)) + obj.save() + class MirrorProtocolAdmin(admin.ModelAdmin): list_display = ('protocol', 'is_download', 'default') |