Issue #2 resolved

PrivateFileField constructor ignores condition callable parameter

Bernardo Cabezas Serra avatarBernardo Cabezas Serra created an issue

Hello, There is a typo in constructor, that makes object ignore the condition parameter.

Here is the simple patch that worked for me. Regards, Bernardo --------------

diff -r 88ac49621de3 private_files/models/fields.py
--- a/private_files/models/fields.py	Thu Mar 24 11:45:42 2011 +0100
+++ b/private_files/models/fields.py	Thu May 19 10:53:14 2011 +0200
@@ -38,5 +38,5 @@
     
     def __init__(self, verbose_name=None, name=None, upload_to='', storage=None, condition = is_user_authenticated, attachment = True, **kwargs):
         super(PrivateFileField, self).__init__(verbose_name, name, upload_to, storage, **kwargs)
-        self.condition = is_user_authenticated
+        self.condition = condition
         self.attachment = attachment

Comments (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.