PB-22e: stripe database functionality - #57
Conversation
|
possible name conflict, backend gets stacktrace. Draft until fixed |
There was a problem hiding this comment.
Får en bug i StripeCustomerRepository.get_by_id(customer_id) i get_by_customer_id() i update i stripe_customer_service. Hverken jeg eller gjengen i chatgpt har helt skjønt hva den kommer fra enda.
Eksempelet:
stripe_customer:StripeCustomer = stripe_service.get_by_customer_id(stripe_customer_id)
stripe_customer.is_premium = True
stripe_customer_dict = stripe_customer.__dict__
print(type(stripe_customer_dict))
print(stripe_customer_dict)
stripe_customer_dict.pop("_sa_instance_state", None)
stripe_customer_dict['created_at'] = stripe_customer_dict['created_at'].isoformat()
try:
t = stripe_service.update(data=stripe_customer_dict, customer_id=stripe_customer.customer_id)
except Exception as e:
print(e)
gir:
StripeCustomerRepository' object has no attribute '_sa_instance_state'
Mulig å se i pb-22d-stripe-webhook-functionality for mer logs og mer fullstendig eksempel.
Kan det komme av noe feil med migrations? (var jo noe knot der)
hmm, ja kk. Håper dette ikke er en case av "dette funker på min maskin". Jeg skal sjekke det ut, men får nok ikke tid til det før onsdag |
|
|
||
|
|
||
| class StripeCustomerRepository(StripeCustomer, CrudMixin): | ||
| pass |
There was a problem hiding this comment.
Hvorfor trenger vi klassen om den ikke gjør noe? Fungerer den som et slags tomt mellomlag?

Adds stripe customer table in a 1:1 relationship with a slack_organization.
Contains fields:
Run the backend docker container and in its terminal run
flask db upgradeto run the migration