aboutsummaryrefslogtreecommitdiffstats
path: root/django/social/admin.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/social/admin.py')
-rw-r--r--django/social/admin.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/django/social/admin.py b/django/social/admin.py
new file mode 100644
index 0000000..3084240
--- /dev/null
+++ b/django/social/admin.py
@@ -0,0 +1,17 @@
+from django.contrib import admin
+from .models import Link
+
+
+# Register your models here.
+
+class LinkAdmin(admin.ModelAdmin):
+ readonly_fields = ('created', 'updated')
+
+ def get_readonly_fields(self, request, obj=None):
+ if request.user.groups.filter(name='Personal').exists():
+ return ('key', 'name')
+ else:
+ return ('created', 'updated')
+
+
+admin.site.register(Link, LinkAdmin)