mirror of
https://github.com/pretix/pretix.git
synced 2026-02-26 10:02:27 +00:00
Compare commits
3 Commits
stable
...
datasync-l
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1011ef7cc9 | ||
|
|
8829050eb9 | ||
|
|
5027f6dd59 |
@@ -19,4 +19,4 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||||
# <https://www.gnu.org/licenses/>.
|
# <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
__version__ = "2026.2.0"
|
__version__ = "2026.3.0.dev0"
|
||||||
|
|||||||
@@ -216,7 +216,10 @@ class OutboundSyncProvider:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
mapped_objects = self.sync_order(sq.order)
|
mapped_objects = self.sync_order(sq.order)
|
||||||
if not all(all(not res or res.sync_info.get("action", "") == "nothing_to_do" for res in res_list) for res_list in mapped_objects.values()):
|
actions_taken = [res and res.sync_info.get("action", "") for res_list in mapped_objects.values() for res in res_list]
|
||||||
|
should_write_logentry = any(action not in (None, "nothing_to_do") for action in actions_taken)
|
||||||
|
logger.info('Synced order %s to %s, actions: %r, log: %r', sq.order.code, sq.sync_provider, actions_taken, should_write_logentry)
|
||||||
|
if should_write_logentry:
|
||||||
sq.order.log_action("pretix.event.order.data_sync.success", {
|
sq.order.log_action("pretix.event.order.data_sync.success", {
|
||||||
"provider": self.identifier,
|
"provider": self.identifier,
|
||||||
"objects": {
|
"objects": {
|
||||||
@@ -237,7 +240,7 @@ class OutboundSyncProvider:
|
|||||||
sq.set_sync_error("exceeded", e.messages, e.full_message)
|
sq.set_sync_error("exceeded", e.messages, e.full_message)
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Could not sync order {sq.order.code} to {type(self).__name__} "
|
f"Could not sync order {sq.order.code} to {sq.sync_provider} "
|
||||||
f"(transient error, attempt #{sq.failed_attempts}, next {sq.not_before})",
|
f"(transient error, attempt #{sq.failed_attempts}, next {sq.not_before})",
|
||||||
exc_info=True,
|
exc_info=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class OrderSyncQueue(models.Model):
|
|||||||
|
|
||||||
def set_sync_error(self, failure_mode, messages, full_message):
|
def set_sync_error(self, failure_mode, messages, full_message):
|
||||||
logger.exception(
|
logger.exception(
|
||||||
f"Could not sync order {self.order.code} to {type(self).__name__} ({failure_mode})"
|
f"Could not sync order {self.order.code} to {self.sync_provider} ({failure_mode})"
|
||||||
)
|
)
|
||||||
self.order.log_action(f"pretix.event.order.data_sync.failed.{failure_mode}", {
|
self.order.log_action(f"pretix.event.order.data_sync.failed.{failure_mode}", {
|
||||||
"provider": self.sync_provider,
|
"provider": self.sync_provider,
|
||||||
|
|||||||
Reference in New Issue
Block a user