From 414d739ff85a827c6391ecfdb1d5b3ad0f7dad7c Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 6 Mar 2018 12:25:48 +0100 Subject: [PATCH] Fixed issue #1856 as a follow up of issue #949: Unpermitted customer field in customer create ticket view. --- app/assets/javascripts/app/lib/app_post/auth.coffee | 4 ---- .../javascripts/app/models/_application_model.coffee | 9 ++++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/auth.coffee b/app/assets/javascripts/app/lib/app_post/auth.coffee index 7f95f2375..c15c6b2e7 100644 --- a/app/assets/javascripts/app/lib/app_post/auth.coffee +++ b/app/assets/javascripts/app/lib/app_post/auth.coffee @@ -150,10 +150,6 @@ class App.Auth # clear all in-memory data of all App.Model's for model_key, model_object of App - if _.isFunction(model_object.resetCallbacks) - model_object.resetCallbacks() - if _.isFunction(model_object.resetAttributes) - model_object.resetAttributes() if _.isFunction(model_object.clearInMemory) model_object.clearInMemory() diff --git a/app/assets/javascripts/app/models/_application_model.coffee b/app/assets/javascripts/app/models/_application_model.coffee index ba5b442d3..ce05630e6 100644 --- a/app/assets/javascripts/app/models/_application_model.coffee +++ b/app/assets/javascripts/app/models/_application_model.coffee @@ -816,17 +816,16 @@ set new attributes of model (remove already available attributes) ) @clearInMemory: -> - return if !@className + # reset callbacks to session based functions + @resetCallbacks() # reset attributes to prevent cached forms on relogin - if !_.isEmpty(App[@className].org_configure_attributes) - App[@className].configure_attributes = App[@className].org_configure_attributes + @resetAttributes() # reset cached values of model - App[@className].deleteAll() + @deleteAll() @updateAttributes: (attributes) -> - return if !@className if _.isEmpty(@org_configure_attributes) # use jquery instead of ._clone() because we need a deep copy of the obj