From 6914180c24735f294b637f6451cc4a9a60a033e8 Mon Sep 17 00:00:00 2001
From: inso <insomniak.fr@gmaiL.com>
Date: Sat, 21 Jan 2017 22:32:22 +0100
Subject: [PATCH] rename files

---
 res/i18n/ts/{cs_CZ.ts => cs.ts}              | 2 +-
 res/i18n/ts/{de_DE.ts => de.ts}              | 2 +-
 res/i18n/ts/{es_ES.ts => es.ts}              | 2 +-
 res/i18n/ts/{fr_FR.ts => fr.ts}              | 2 +-
 res/i18n/ts/{it_IT.ts => it.ts}              | 2 +-
 res/i18n/ts/{pl_PL.ts => pl.ts}              | 2 +-
 res/i18n/ts/{pt_BR.ts => pt.ts}              | 2 +-
 res/i18n/ts/{ru_RU.ts => ru.ts}              | 2 +-
 src/sakia/gui/dialogs/certification/model.py | 2 +-
 src/sakia/services/documents.py              | 1 +
 10 files changed, 10 insertions(+), 9 deletions(-)
 rename res/i18n/ts/{cs_CZ.ts => cs.ts} (99%)
 rename res/i18n/ts/{de_DE.ts => de.ts} (99%)
 rename res/i18n/ts/{es_ES.ts => es.ts} (99%)
 rename res/i18n/ts/{fr_FR.ts => fr.ts} (99%)
 rename res/i18n/ts/{it_IT.ts => it.ts} (99%)
 rename res/i18n/ts/{pl_PL.ts => pl.ts} (99%)
 rename res/i18n/ts/{pt_BR.ts => pt.ts} (99%)
 rename res/i18n/ts/{ru_RU.ts => ru.ts} (99%)

diff --git a/res/i18n/ts/cs_CZ.ts b/res/i18n/ts/cs.ts
similarity index 99%
rename from res/i18n/ts/cs_CZ.ts
rename to res/i18n/ts/cs.ts
index 10082ced..119eb92b 100644
--- a/res/i18n/ts/cs_CZ.ts
+++ b/res/i18n/ts/cs.ts
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="cs_CZ" sourcelanguage="en">
+<TS version="2.0" language="cs" sourcelanguage="en">
 <context>
     <name>@default</name>
     <message>
diff --git a/res/i18n/ts/de_DE.ts b/res/i18n/ts/de.ts
similarity index 99%
rename from res/i18n/ts/de_DE.ts
rename to res/i18n/ts/de.ts
index 802afe5c..ad170797 100644
--- a/res/i18n/ts/de_DE.ts
+++ b/res/i18n/ts/de.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="de_DE" sourcelanguage="">
+<!DOCTYPE TS><TS version="2.0" language="de" sourcelanguage="">
 <context>
     <name>AboutPopup</name>
     <message>
diff --git a/res/i18n/ts/es_ES.ts b/res/i18n/ts/es.ts
similarity index 99%
rename from res/i18n/ts/es_ES.ts
rename to res/i18n/ts/es.ts
index 57f42f1d..2d22dec3 100644
--- a/res/i18n/ts/es_ES.ts
+++ b/res/i18n/ts/es.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="es_ES" sourcelanguage="">
+<!DOCTYPE TS><TS version="2.0" language="es" sourcelanguage="">
 <context>
     <name>AboutPopup</name>
     <message>
diff --git a/res/i18n/ts/fr_FR.ts b/res/i18n/ts/fr.ts
similarity index 99%
rename from res/i18n/ts/fr_FR.ts
rename to res/i18n/ts/fr.ts
index e504837f..932df4bc 100644
--- a/res/i18n/ts/fr_FR.ts
+++ b/res/i18n/ts/fr.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="fr_FR" sourcelanguage="en">
+<!DOCTYPE TS><TS version="2.0" language="fr" sourcelanguage="en">
 <context>
     <name>@default</name>
     <message>
diff --git a/res/i18n/ts/it_IT.ts b/res/i18n/ts/it.ts
similarity index 99%
rename from res/i18n/ts/it_IT.ts
rename to res/i18n/ts/it.ts
index 5eed7bcc..43f2ec85 100644
--- a/res/i18n/ts/it_IT.ts
+++ b/res/i18n/ts/it.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="it_IT" sourcelanguage="">
+<!DOCTYPE TS><TS version="2.0" language="it" sourcelanguage="">
 <context>
     <name>AboutPopup</name>
     <message>
diff --git a/res/i18n/ts/pl_PL.ts b/res/i18n/ts/pl.ts
similarity index 99%
rename from res/i18n/ts/pl_PL.ts
rename to res/i18n/ts/pl.ts
index 7f6f3548..3bcd35f6 100644
--- a/res/i18n/ts/pl_PL.ts
+++ b/res/i18n/ts/pl.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="pl_PL" sourcelanguage="">
+<!DOCTYPE TS><TS version="2.0" language="pl" sourcelanguage="">
 <context>
     <name>AboutPopup</name>
     <message>
diff --git a/res/i18n/ts/pt_BR.ts b/res/i18n/ts/pt.ts
similarity index 99%
rename from res/i18n/ts/pt_BR.ts
rename to res/i18n/ts/pt.ts
index b3cdb8eb..58d1940b 100644
--- a/res/i18n/ts/pt_BR.ts
+++ b/res/i18n/ts/pt.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="pt_BR" sourcelanguage="">
+<!DOCTYPE TS><TS version="2.0" language="pt" sourcelanguage="">
 <context>
     <name>AboutPopup</name>
     <message>
diff --git a/res/i18n/ts/ru_RU.ts b/res/i18n/ts/ru.ts
similarity index 99%
rename from res/i18n/ts/ru_RU.ts
rename to res/i18n/ts/ru.ts
index 4608ddf3..86bb350c 100644
--- a/res/i18n/ts/ru_RU.ts
+++ b/res/i18n/ts/ru.ts
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="2.0" language="ru_RU" sourcelanguage="">
+<!DOCTYPE TS><TS version="2.0" language="ru" sourcelanguage="">
 <context>
     <name>AboutPopup</name>
     <message>
diff --git a/src/sakia/gui/dialogs/certification/model.py b/src/sakia/gui/dialogs/certification/model.py
index e9d27387..c1ba9f6f 100644
--- a/src/sakia/gui/dialogs/certification/model.py
+++ b/src/sakia/gui/dialogs/certification/model.py
@@ -92,10 +92,10 @@ class CertificationModel(QObject):
     async def certify_identity(self, password, identity):
         result = await self.app.documents_service.certify(self.connection, password, identity)
         if result[0]:
-            self._identities_processor.insert_or_update_identity(identity)
             connection_identity = self._identities_processor.get_identity(self.connection.currency,
                                                                           self.connection.pubkey,
                                                                           self.connection.uid)
+            self.app.db.commit()
             self.app.identity_changed.emit(connection_identity)
             self.app.identity_changed.emit(identity)
         return result
diff --git a/src/sakia/services/documents.py b/src/sakia/services/documents.py
index 3be55c31..6a75fbb5 100644
--- a/src/sakia/services/documents.py
+++ b/src/sakia/services/documents.py
@@ -163,6 +163,7 @@ class DocumentsService:
         responses = await self._bma_connector.broadcast(connection.currency, bma.wot.certify, req_args={'cert': signed_cert})
         result = await parse_bma_responses(responses)
         if result[0]:
+            self._identities_processor.insert_or_update_identity(identity)
             self._certifications_processor.create_or_update_certification(connection.currency, certification,
                                                                           timestamp, BlockUID.empty())
 
-- 
GitLab