Skip to content

Commit 536fc03

Browse files
committed
chore: handle eshipper credential transfer from username|password to principal|credential
1 parent 06e378d commit 536fc03

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

modules/core/karrio/server/providers/migrations/0078_auto_20240813_1552.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Generated by Django 4.2.15 on 2024-08-13 15:52
22

3+
import karrio.lib as lib
34
from django import forms
45
import django.conf as conf
5-
from django.db import migrations
66
import karrio.server.core.models
77
from django.db import migrations, models, transaction
88

@@ -69,6 +69,20 @@ def forwards_func(apps, schema_editor):
6969
_carrier.carrier_code = "usps_wt"
7070
if _carrier_name == "usps_international":
7171
_carrier.carrier_code = "usps_wt_international"
72+
if _carrier_name == "eshipper":
73+
_carrier.credentials = {
74+
**_carrier.credentials,
75+
"principal": lib.identity(
76+
_settings.get("principal")
77+
if any(_settings.get("principal") or "")
78+
else _settings.get("username")
79+
),
80+
"credential": lib.identity(
81+
_settings.get("credential")
82+
if any(_settings.get("credential") or "")
83+
else _settings.get("password")
84+
),
85+
}
7286

7387
if any(_services):
7488
settings = getattr(_carrier, MODELS[_carrier_name].__name__.lower())

0 commit comments

Comments
 (0)