feat(core): If user context not supplied, dont create audithistory for model

this allows tests and direct creation via code if required.

ref: #789 #759
This commit is contained in:
2025-06-06 04:15:13 +09:30
parent a8e2536bd2
commit 7691ad5b0b
9 changed files with 12 additions and 76 deletions

View File

@ -31,17 +31,11 @@ def kwargs_knowledgebase(django_db_blocker,
password = 'apassword'
)
default_context_user = model_knowledgebasecategory.context['user']
model_knowledgebasecategory.context['user'] = user
category = model_knowledgebasecategory.objects.create(
organization = kwargs_centurionmodel['organization'],
name = 'kb cat for kb art' + random_str
)
category.context['user'] = default_context_user
model_knowledgebasecategory.context['user'] = default_context_user
kwargs = {
**kwargs_centurionmodel.copy(),
'title': 'title' + random_str,