option to make publish date editable 0.7.4
authorJan Szejko <janek37@gmail.com>
Wed, 10 May 2017 14:18:58 +0000 (16:18 +0200)
committerJan Szejko <janek37@gmail.com>
Wed, 10 May 2017 14:20:31 +0000 (16:20 +0200)
migdal/__init__.py
migdal/admin.py
setup.py

index dda9569..cfe66c7 100644 (file)
@@ -47,4 +47,6 @@ class Settings(AppSettings):
         return tuple(lang for lang in settings.LANGUAGES if lang not in self.OBLIGATORY_LANGUAGES)
     OPTIONAL_LANGUAGES = None
 
+    PUBLISH_DATE_EDITABLE = False
+
 app_settings = Settings('MIGDAL')
index f9974be..a03d16c 100644 (file)
@@ -37,8 +37,9 @@ def filtered_entry_admin(typ):
             return field
 
         date_hierarchy = 'date'
-        readonly_fields = ('date', 'changed_at', 'first_published_at') + \
-            translated_fields(('published_at',))
+        readonly_fields = ('date', 'changed_at') + translated_fields(('published_at',))
+        if app_settings.PUBLISH_DATE_EDITABLE:
+            readonly_fields += ('first_published_at',)
         _promo_if_necessary = ('promo',) if typ.promotable else ()
 
         fieldsets = (
index db5d4ed..69acd90 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ def whole_trees(package_dir, paths):
 
 setup(
     name='django-migdal',
-    version='0.7.3',
+    version='0.7.4',
     author='Radek Czajka',
     author_email='radoslaw.czajka@nowoczesnapolska.org.pl',
     maintainer='Jan Szejko',