@@ -112,6 +112,19 @@ async def revoke_credential(
112112 f"No revocation registry record found for id: { rev_reg_id } "
113113 )
114114
115+ if notify :
116+ thread_id = thread_id or f"indy::{ rev_reg_id } ::{ cred_rev_id } "
117+ rev_notify_rec = RevNotificationRecord (
118+ rev_reg_id = rev_reg_id ,
119+ cred_rev_id = cred_rev_id ,
120+ thread_id = thread_id ,
121+ connection_id = connection_id ,
122+ comment = comment ,
123+ version = notify_version ,
124+ )
125+ async with self ._profile .session () as session :
126+ await rev_notify_rec .save (session , reason = "New revocation notification" )
127+
115128 if publish :
116129 await revoc .get_or_fetch_local_tails_path (rev_reg_def )
117130 result = await revoc .revoke_pending_credentials (
@@ -131,18 +144,6 @@ async def revoke_credential(
131144
132145 else :
133146 await revoc .mark_pending_revocations (rev_reg_id , int (cred_rev_id ))
134- if notify :
135- thread_id = thread_id or f"indy::{ rev_reg_id } ::{ cred_rev_id } "
136- rev_notify_rec = RevNotificationRecord (
137- rev_reg_id = rev_reg_id ,
138- cred_rev_id = cred_rev_id ,
139- thread_id = thread_id ,
140- connection_id = connection_id ,
141- comment = comment ,
142- version = notify_version ,
143- )
144- async with self ._profile .session () as session :
145- await rev_notify_rec .save (session , reason = "New revocation notification" )
146147
147148 async def update_rev_reg_revoked_state (
148149 self ,
0 commit comments