Commits

MattoTodd  committed 97bf8d2

Adding ability to edit all articles as non-admin

  • Participants
  • Parent commits da2f7cb

Comments (0)

Files changed (2)

-syntax: glob
-*.pyc
-*.swp
-*.swo
-build/
-dist/
-django_articles.egg-info
-MANIFEST
-
+glob:client/Flash/Apps/VideoAppPlayer/bin-debug/
+glob:client/Flash/Build/buildsuccessful.txt
+glob:client/Flash/Core/bin/
+glob:client/Flash/Build/bin-release/
+glob:client/Flash/Libs/SwizFramework/bin/
+glob:client/Flash/Build/build.properties
+glob:client/Flash/Core/config.xml
+glob:client/Flash/Libs/SwizFramework/config.xml
+glob:client/Flash/Libs/FlexUnit/bin/
+glob:client/Flash/Libs/AdobeCoreLib/config.xml
+glob:client/Flash/Libs/AdobeCoreLib/bin/
+glob:.metadata/
+glob:client/Flash/CoreTest/bin-debug/
+glob:*.pyc
+glob:.tmp_*
+glob:client/Flash/Apps/VideoAppPlayerDesignMode/bin-debug/
+glob:*.tar
+glob:*.gz
+glob:.idea/*
+glob:client/Flash/Apps/WebcamRecorder/bin-debug/
+glob:server/static/test.html
+glob:server/static/temp/
+(^|/)\.
+

File articles/admin.py

+from django.conf import settings
 from django.contrib import admin
 from django.contrib.auth.models import User
 from django.contrib.sites.models import Site
 
     def queryset(self, request):
         """Limit the list of articles to article posted by this user unless they're a superuser"""
+        """If ARTICLES_OPEN_EDITING is set to True in your settings, any user can view and edit all articles"""
 
-        if request.user.is_superuser:
+        if request.user.is_superuser or (hasattr(settings, 'ARTICLES_OPEN_EDITING') and settings.ARTICLES_OPEN_EDITING == True):
             return self.model._default_manager.all()
         else:
             return self.model._default_manager.filter(author=request.user)