Commit Graph

60 Commits

Author SHA1 Message Date
Roberto Rosario
a7b31fc171 Refactor and implement download code natively
- Use modified port of Django 2.2 FileResponse.
- Remove Django DownloadView library.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-12-12 19:39:44 -04:00
Roberto Rosario
ad37228466 Add converter layers, redactions app
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-08-20 00:21:03 -04:00
Roberto Rosario
4dd270e75b Add mixins to retrieve content type object
Add ContentTypeViewMixin and ExternalContentTypeObjectMixin.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-08-05 00:27:15 -04:00
Roberto Rosario
3428c6aa20 Update ExternalObjectMixin
Call ModelPermission to select the proper manager for the queryset
when specifying just the model.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-08-05 00:23:45 -04:00
Roberto Rosario
cc81a6905a Add kwargs
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-07-30 03:10:25 -04:00
Roberto Rosario
111250fd99 Update usage of "an user"
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-06-15 02:17:55 -04:00
Roberto Rosario
c7e9a4dc99 Add keyword arguments
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-12 02:09:26 -04:00
Roberto Rosario
545366a477 Operate only on the filtered selection queryset
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-11 18:14:10 -04:00
Roberto Rosario
28114264c1 Remove last use of settings.LOGIN_REDIRECT_URL
Replace with common.settings_home_view.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-07 13:32:47 -04:00
Roberto Rosario
5e4518211f Remove related attribute of check_access
Remove filter_by_access. Replaced by restrict_queryset.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-07 02:26:50 -04:00
Roberto Rosario
95a1df8072 Backport common mixin and generics improvements
* Rename get_object_list to get_source_queryset.
* Add uniqueness validation to SingleObjectCreateView.
* Remove MultipleInstanceActionMixin.
* Backport MultipleObjectMixin improvements.
* Remove ObjectListPermissionFilterMixin.
* Add and improve tests.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-06 02:07:35 -04:00
Roberto Rosario
8e731d6280 Backport ACL computation improvements
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-05-04 03:27:30 -04:00
Roberto Rosario
2330bb9da2 Add RestrictedQueryset mixin
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-24 22:19:59 -04:00
Roberto Rosario
5cde7de29b Add the external object mixin
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-24 04:51:33 -04:00
Roberto Rosario
f3413b4283 Backport and remove code from the permission app
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2019-04-13 01:43:03 -04:00
Roberto Rosario
36a51eeb73 Switch to full app paths
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.

This solves name clashes 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>
2019-04-05 02:02:57 -04:00
Roberto Rosario
ec44e81864 Add support to the ObjectActionMixin to report on instance action failures. Add also an error_message class property and the new ActionError exception.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-08-23 01:48:43 -04:00
Roberto Rosario
7b38cffd85 Fix typo
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-06 02:03:46 -04:00
Roberto Rosario
b0c2d6cd76 Allow ObjectListPermissionFilterMixin to check access against a parent object and not just against the queryser of child objects.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2018-04-06 01:13:10 -04:00
Michael Price
de65d96fe2 Update cabinets and document_index api views docstrings. Update multi level docstrings as per Python best practices.
Signed-off-by: Michael Price <loneviking72@gmail.com>
2018-04-01 20:27:45 -04:00
Roberto Rosario
2052caada4 Remove PreserveGetQuerySet mixin. Update SingleObjectList and
MultipleObjectFormActionView views to use a new get_object_list method.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-16 22:12:24 -04:00
Roberto Rosario
6ec235afc0 Add support for multiple dashboards.
Add support for removing dashboard widgets.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-08-10 02:56:40 -04:00
Roberto Rosario
d49a5f43ed Add missing replacements of reverse to resolve_url.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-25 08:23:26 -04:00
Roberto Rosario
f09321f6ab Fix deprecation warnings for Django 1.11 and Django 2.0.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-21 00:25:18 -04:00
Roberto Rosario
fb520d6f92 Add view mixin to make sure a subclass can't override its
parent's get_queryset method.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-14 05:19:50 -04:00
Roberto Rosario
a72ac6eadb Add user mailer backends support. GitLab issue #286.
Add support for creating dynamic forms.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-07-03 13:37:56 -04:00
Roberto Rosario
63682a2945 Merge remote-tracking branch 'origin/master' into feature/master_merge
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-03-14 15:57:38 -04:00
Roberto Rosario
6e1cf57079 Implement document workflows transition ACLs. GitLab issue #321.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
2017-02-20 02:37:42 -04:00
Roberto Rosario
5167bbadee Refactor the document metadata add, edit and remove views. 2016-12-28 00:57:04 -04:00
Roberto Rosario
c21eb6d4cf Refacto ActionView into MultipleObjectFormActionView and MultipleObjectConfirmActionView.
Split ActionView into smaller mixins.
2016-12-21 03:27:27 -04:00
Roberto Rosario
5893e149e0 Reduce the check_access boilerplate code. 2016-11-02 04:58:05 -04:00
Roberto Rosario
621c988809 Simplify filter_by_access boilerplate code 2016-11-02 03:48:16 -04:00
Roberto Rosario
6e3d99670c Complete conversion of download views to CBV views using django-downloadview.
This also removes dependency on the filetransfers library.
2016-10-31 01:00:35 -04:00
Roberto Rosario
286a6ba9b8 Enable object access check via related attribute in generic CBV. 2016-03-19 02:51:03 -04:00
Roberto Rosario
ed8ac47240 Extract context object name from the models meta options. 2016-03-19 01:57:30 -04:00
Roberto Rosario
27d8644438 Silence 90% of remaining Django 1.8 model warnings. 2016-01-28 05:43:08 -04:00
Roberto Rosario
ec4324a3d6 Make arguments explicit. 2015-11-04 01:42:43 -04:00
Roberto Rosario
a1a0a6da52 PEP8 Cleanups. 2015-10-28 02:14:48 -04:00
Roberto Rosario
6f82ee8cb5 Make MultipleInstanceActionMixin operate on a queryset and not on a list of objects. Get the id_list from GET or POST requests, not just GET requests. 2015-10-21 03:41:12 -04:00
Roberto Rosario
c796f2b2c4 TODO comment cleanups. Remove unused Document model method. 2015-09-26 23:50:57 -04:00
Roberto Rosario
e1a04d9838 Convert document trash view to CBV. Improve ConfirmView based CBVs. 2015-09-15 02:02:38 -04:00
Roberto Rosario
72c63bfedc Improve form and object data passing code. 2015-08-25 20:28:59 -04:00
Roberto Rosario
95cb49bfcb Add mixin to pass extra argument during object deletion. Used for logging the user performing an action. 2015-08-23 22:33:22 -04:00
Roberto Rosario
8cd14a2ae1 Add mixin to add extra instance data to the CBV create and edit views. 2015-08-23 21:37:17 -04:00
Roberto Rosario
68f3c6eee7 PEP8 cleanups. 2015-08-19 14:50:44 -04:00
Roberto Rosario
4527563d89 PEP8 cleanups, specially E501 line too long. 2015-07-22 18:21:37 -04:00
Roberto Rosario
69ea0a61e8 Get post_action_redirect and action_cancel_redirect from methods to allow overriding with context. 2015-07-07 20:46:49 -04:00
Roberto Rosario
924c07c9de Add support for redirection target on confirm dialog cancelation 2015-07-03 20:49:28 -04:00
Roberto Rosario
8575d02286 Add missing imports 2015-07-03 03:24:20 -04:00
Roberto Rosario
509c944df0 Add mixin to apply an action to many instances 2015-07-03 03:20:36 -04:00