summaryrefslogtreecommitdiff
path: root/mirrors/admin.py
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-10-02 20:40:34 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-10-02 20:40:34 -0400
commitea00a099dffd7157c93af54b5817734348d2bbc6 (patch)
tree89fa4ba0c0ac19a4286ba4c4cb64f77536b1a098 /mirrors/admin.py
parent1a1fd4a3d6aa7f6b2338f7751f5f97a30a059a04 (diff)
parent0f0ce18109f8104d7b2abe9024ef26fa07ff0292 (diff)
Merge branch 'archweb' into archweb-generic
Conflicts: templates/public/download.html templates/public/index.html
Diffstat (limited to 'mirrors/admin.py')
-rw-r--r--mirrors/admin.py10
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')