From 50207143df534b12dc100e9db2b84ff84ea2a9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Fri, 6 Jan 2012 09:26:18 +0100 Subject: Fixed problem with creating events. --- sublab_project/calendarium/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sublab_project/calendarium/admin.py b/sublab_project/calendarium/admin.py index 95d648c..608a66d 100644 --- a/sublab_project/calendarium/admin.py +++ b/sublab_project/calendarium/admin.py @@ -21,7 +21,7 @@ class EventAdmin(admin.ModelAdmin): def get_readonly_fields(self, request, obj=None): """Sets all fields read only if source is "import". """ - if obj.source == obj.SOURCE_IMPORT: + if obj and obj.source == obj.SOURCE_IMPORT: return ['name', 'description', 'start', 'end'] return [] -- cgit v1.2.1