aboutsummaryrefslogtreecommitdiffstats
path: root/django/social/admin.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-01-13 18:08:28 -0500
committerJesús <heckyel@hyperbola.info>2022-01-13 18:08:28 -0500
commit4317b0ba5d614fb6f9f3d3ee333848e9774700ba (patch)
treef474806ce968874db270926dcb0399b7f3139d18 /django/social/admin.py
parentb77c06257f9b650e2274c7dcb8937c237353c64d (diff)
downloadpersonal-site-4317b0ba5d614fb6f9f3d3ee333848e9774700ba.tar.lz
personal-site-4317b0ba5d614fb6f9f3d3ee333848e9774700ba.tar.xz
personal-site-4317b0ba5d614fb6f9f3d3ee333848e9774700ba.zip
Add docker support
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)