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:
@@ -26,12 +26,14 @@ class DocumentCheckoutDefailForm(DetailForm):
|
||||
extra_fields = (
|
||||
{
|
||||
'label': _('Document status'),
|
||||
'field': lambda instance: STATE_LABELS[instance.checkout_state()]
|
||||
'field': lambda instance: STATE_LABELS[
|
||||
instance.get_check_out_state()
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
if instance.is_checked_out():
|
||||
checkout_info = instance.checkout_info()
|
||||
checkout_info = instance.get_check_out_info()
|
||||
extra_fields += (
|
||||
{
|
||||
'label': _('User'),
|
||||
|
||||
Reference in New Issue
Block a user