Move add_to_class functions to their own module

* The new module is called methods.py and found on each app.
* Add keyword arguments to add_to_class instances.
* Remove catch all exception handling for the check in and
  check out views.
* Improve checkouts tests code reducing redundant code.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-11 18:03:53 -04:00
parent a12c90268f
commit 456c322c19
33 changed files with 375 additions and 338 deletions
+3 -1
View File
@@ -24,7 +24,9 @@ class ModelPermission(object):
app_label='acls', model_name='AccessControlList'
)
model.add_to_class('acls', GenericRelation(AccessControlList))
model.add_to_class(
name='acls', value=GenericRelation(AccessControlList)
)
@classmethod
def get_classes(cls, as_content_type=False):