add date release

This commit is contained in:
zakhy 2024-10-22 10:07:46 +07:00
parent f613c7b940
commit 8861b27c85

View File

@ -46,11 +46,14 @@ class VersioningConfig(AppConfig):
callback_function = getattr(settings, 'VERSION_UPDATE_CALLBACK', None)
if callback_function:
# Если функция-callback задана, то вызываем ее
call_version_update_callback(callback_function, update_log_obj.version, update_log_obj.description)
call_version_update_callback(callback_function,
update_log_obj.date_release,
update_log_obj.version,
update_log_obj.description)
os.remove(update_file_path)
def call_version_update_callback(callback_path, version, description):
def call_version_update_callback(callback_path, date_release, version, description):
import importlib
import traceback
@ -59,6 +62,6 @@ def call_version_update_callback(callback_path, version, description):
module_name, function_name = callback_path.rsplit('.', 1)
module = importlib.import_module(module_name)
callback_function = getattr(module, function_name)
callback_function(version, description)
callback_function(date_release, version, description)
except Exception as e:
print('error while callback:', traceback.format_exc())