EduardoZepeda / django-payments-mercadopago

A mercadopago payment gateway backend for django-payments.
MIT License
13 stars 1 forks source link

Use primary key instead of hard-coding `id` #1

Closed WhyNotHugo closed 2 years ago

WhyNotHugo commented 3 years ago

BasePayment doesn't specify a primary key, so it will use whatever is defined in the non-abstract class.

This is frequently id, but can be any value (I use uuid in a few apps of mine).

This tiny change makes the provider use the pk alias, instead of hardcoding id. This is functionally equivalent if your primary key is id, but also works if your primary key is uuid or anything else.