@@ -470,7 +470,6 @@ def auto_save_post_to_git(sender, instance, created, **kwargs):
470
470
instance = Post .objects .get (pk = instance .pk )
471
471
472
472
data = {
473
- "uuid" : instance .uuid ,
474
473
"title" : instance .title ,
475
474
"subtitle" : instance .subtitle ,
476
475
"slug" : instance .slug ,
@@ -502,6 +501,9 @@ def auto_save_post_to_git(sender, instance, created, **kwargs):
502
501
"author_tags" : [tag .name for tag in instance .author_tags .all ()],
503
502
}
504
503
504
+ if instance .uuid :
505
+ data .update ({'uuid' : instance .uuid })
506
+
505
507
# NOTE: If newly created always give it the highest ordering position
506
508
if created :
507
509
Post .objects .exclude (pk = instance .pk ).update (position = F ('position' ) + 1 )
@@ -546,7 +548,6 @@ def auto_delete_post_to_git(sender, instance, **kwargs):
546
548
def auto_save_category_to_git (sender , instance , created , ** kwargs ):
547
549
548
550
data = {
549
- "uuid" : instance .uuid ,
550
551
"title" : instance .title ,
551
552
"subtitle" : instance .subtitle ,
552
553
"slug" : instance .slug ,
@@ -562,6 +563,9 @@ def auto_save_category_to_git(sender, instance, created, **kwargs):
562
563
"image_host" : settings .THUMBOR_SERVER ,
563
564
}
564
565
566
+ if instance .uuid :
567
+ data .update ({'uuid' : instance .uuid })
568
+
565
569
workspace = EG .workspace (settings .GIT_REPO_PATH ,
566
570
index_prefix = settings .ELASTIC_GIT_INDEX_PREFIX ,
567
571
es = {'urls' : [settings .ELASTICSEARCH_HOST ]})
0 commit comments