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:
@@ -11,7 +11,9 @@ class ErrorLogEntryManager(models.Manager):
|
||||
ErrorLogEntry = apps.get_model(
|
||||
app_label='common', model_name='ErrorLogEntry'
|
||||
)
|
||||
model.add_to_class('error_logs', GenericRelation(ErrorLogEntry))
|
||||
model.add_to_class(
|
||||
name='error_logs', value=GenericRelation(ErrorLogEntry)
|
||||
)
|
||||
|
||||
|
||||
class UserLocaleProfileManager(models.Manager):
|
||||
|
||||
Reference in New Issue
Block a user