Issue #129: Updated payment method display in the profile registrations list, added a method column to the Payment model, updated save payment code for registration and membership features.#131
Conversation
…ns list, added a `method` column to the `Payment` model, updated save payment code for registration and membership features.
83464c8 to
3d505e3
Compare
dds_registration/models.py
Outdated
| ] | ||
| DEFAULT_METHOD = "INVOICE" | ||
|
|
||
| method = models.TextField(choices=METHODS, default=DEFAULT_METHOD) |
There was a problem hiding this comment.
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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.
7c0b8e9 to
e7f7280
Compare
| # invoice or a receipt | ||
| data = models.JSONField(help_text="Read-only JSON object", default=dict) | ||
|
|
||
| def get_data(self): |
There was a problem hiding this comment.
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.
No description provided.