When there is no HTTP referer fallback to
common.settings_home_view instead of LOGIN_REDIRECT_URL.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Normally the MultipleObjectMixin class view only allows
id_list from the GET request. This is updated to allow
that query from POST requests like those produced by the
view tests.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add keyword arguments.
Sort arguments.
Unify the ObjectListPermissionFilterMixin and
ObjectPermissionCheckMixin into the RestrictedQuerysetMixin.
Add MultipleObjectDownloadView.
Update SingleObjectDownloadView to do queryset filtering.
The method that returns the base queryset for views is
now named get_source_queryset().
The views now use .get_object_list as a multi object
homologous of get_object. The queryset returned by
.get_object_list is restricted by access.
Make MultipleObjectMixin a subclass of Django's
SingleObjectMixin to reduce repeated code.
All generic views are now imported from common.generics and not
from common.views.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
With the interface finalized, replace .filter_by_access() in
the generic view mixins with restrict_queryset().
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Remove explict support for raising 404 error when the
object access fails.
The new method to use is to restrict the queryset using
the .restrict_queryset manager method and then .get() the
desired object. If the object access control failed then
the desired object will not be found in the queryset
and an error 404 will be raised. The end result is the same:
error 404, the method to raise the error is what differs now.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add support to override settings of the FilteredSelectionForm
via subclass attributes. Add keyword arguments to calls.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add a mixin to ease the amount of code and imports required
for views that extract the content type from URL parameters.
Improve ExternalObjectViewMixin by adding a new class attribute
"external_object_pk_url_kwargs" to mechanize URL parameter
extraction. The external_object_pk_url_kwargs maps model
attributes using during manager get or filter from URL parameters.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add keyword arguments to URL definitions and reverse resolution.
Raise HTTP error 404 instead of 403 to reduce the information
divulged. Add view tests.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.
This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.
Every app reference is now prepended with 'mayan.apps'.
Existing config.yml files need to be updated manually.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>