diff --git a/glare/engine.py b/glare/engine.py index ec7eb00..159c943 100644 --- a/glare/engine.py +++ b/glare/engine.py @@ -151,7 +151,7 @@ class Engine(object): action_names = ['update'] af_dict = af.to_dict() policy.authorize('artifact:update', af_dict, context) - af.pre_update_hook(context, af) + af.pre_update_hook_with_patch(context, af, patch) try: for operation in patch._ops: # apply the change to make sure that it's correct diff --git a/glare/objects/base.py b/glare/objects/base.py index 73aa7fd..4e7acd7 100644 --- a/glare/objects/base.py +++ b/glare/objects/base.py @@ -549,6 +549,10 @@ Possible values: def pre_update_hook(cls, context, af): pass + @classmethod + def pre_update_hook_with_patch(cls, context, af, json_patch): + cls.pre_update_hook(context, af) + @classmethod def post_update_hook(cls, context, af): pass