Move filterted from initialization
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -247,14 +247,14 @@ class FilteredSelectionForm(forms.Form):
|
||||
else:
|
||||
widget_class = opts.widget_class
|
||||
|
||||
super(FilteredSelectionForm, self).__init__(*args, **kwargs)
|
||||
|
||||
if opts.permission:
|
||||
queryset = AccessControlList.objects.filter_by_access(
|
||||
permission=opts.permission, queryset=queryset,
|
||||
user=opts.user
|
||||
)
|
||||
|
||||
super(FilteredSelectionForm, self).__init__(*args, **kwargs)
|
||||
|
||||
self.fields[opts.field_name] = field_class(
|
||||
help_text=opts.help_text, label=opts.label,
|
||||
queryset=queryset, required=opts.required,
|
||||
|
||||
Reference in New Issue
Block a user