Skip to content

Conversation

@lilliputten
Copy link
Collaborator

No description provided.

@lilliputten lilliputten requested a review from cmutel April 6, 2024 13:35
@lilliputten lilliputten self-assigned this Apr 6, 2024
@lilliputten lilliputten linked an issue Apr 6, 2024 that may be closed by this pull request
…ns list, added a `method` column to the `Payment` model, updated save payment code for registration and membership features.
@lilliputten lilliputten force-pushed the 129-bug-profile-page-payment-method branch from 83464c8 to 3d505e3 Compare April 6, 2024 13:38
]
DEFAULT_METHOD = "INVOICE"

method = models.TextField(choices=METHODS, default=DEFAULT_METHOD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with this (hiding data in hard-to-access entities isn't a good coding approach), but ok: going to create helpers to extract them from there.

"type": form.cleaned_data["membership_type"],
},
"method": form.cleaned_data["payment_method"],
"method": payment_method,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the idea behind this change? You create a variable to only use it once. I suggest reverting this change.

<td class="col-payment">
{% if payment %}
{{ payment.get_payment_method_display }}
{{ payment.get_method_display }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a method to Payment if this needs to be displayed differently that it is stored. I want to keep all the info in data.

@lilliputten lilliputten force-pushed the 129-bug-profile-page-payment-method branch from 7c0b8e9 to e7f7280 Compare April 6, 2024 15:07
# invoice or a receipt
data = models.JSONField(help_text="Read-only JSON object", default=dict)

def get_data(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No JSON anything is needed, all of that is done automatically. You are making this much more complicated than it needs to be. Please see #133 for a clean way to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Profile page doesn't show payment method correctly

3 participants