Commits

Germano Gabbianelli  committed 7c1524a

Implemented "login_required" for AutocompleteSettings.

  • Participants
  • Parent commits cf292f9

Comments (0)

Files changed (1)

File autocomplete/views.py

     limit = 5
     reverse_label = None
     js_options = {}
+    login_required = False
  
     def label(self, obj):
         return unicode(obj)
             return "%s__icontains" % field_name
 
     def has_permission(self, request):
+        if self.login_required:
+            return request.user.is_authenticated()
         return True
 
     def forbidden(self, request):