summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Zapke-Grùˆndemann <info@keimlink.de>2012-01-06 09:26:18 +0100
committerMarkus Zapke-Grùˆndemann <info@keimlink.de>2012-01-06 09:26:18 +0100
commit50207143df534b12dc100e9db2b84ff84ea2a9e2 (patch)
treebf09dbcfb845ed3a2d5fb39aad3d7baf8b052759
parent138e0e1cd53f7609845c9b1e6da0472c30d5a564 (diff)
Fixed problem with creating events.
-rw-r--r--sublab_project/calendarium/admin.py2
1 files changed, 1 insertions, 1 deletions
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 []