Fix invite text and add accounting context to translation messages #53

Merged
benjaoming merged 1 commit from benjaoming/membersystem:invite-fixes into main 2024-08-14 19:52:12 +00:00
4 changed files with 8 additions and 8 deletions
Showing only changes of commit 19ae307013 - Show all commits

View file

@ -80,8 +80,8 @@ class Order(CreatedModifiedAbstract):
is_paid = models.BooleanField(default=False, verbose_name=_("is paid"))
class Meta:
verbose_name = pgettext_lazy("accounting term", "Order")
verbose_name_plural = pgettext_lazy("accounting term", "Orders")
verbose_name = pgettext_lazy("accounting", "Order")
verbose_name_plural = pgettext_lazy("accounting", "Orders")
def __str__(self) -> str:
return f"Order ID {self.display_id}"

View file

@ -2,7 +2,7 @@
{% load i18n %}
{% block head_title %}
{% trans "Order" %}
{% trans "Order" context "accounting" %}
{% endblock %}
{% block content %}
@ -11,14 +11,14 @@
<h2>Order: {{ order.id }}</h2>
<p>
{% trans "Ordered" %}: {{ order.created }}<br>
{% trans "Status" %}: {{ order.is_paid|yesno:_("paid,unpaid") }}
{% trans "Ordered" context "accounting" %}: {{ order.created }}<br>
{% trans "Status" context "accounting" %}: {{ order.is_paid|yesno:_("paid,unpaid") }}
</p>
<table class="table">
<thead>
<tr>
<th>{% trans "Item" %}</th>
<th>{% trans "Item" context "accounting" %}</th>
<th>{% trans "Quantity" %}</th>
<th>{% trans "Price" %}</th>
<th>{% trans "VAT" %}</th>

View file

@ -56,7 +56,7 @@ class BaseEmail(EmailMessage):
c["request"] = self.request
c["domain"] = site.domain
c["site_name"] = site.name
c["protocol"] = "http" if self.request and not self.request.is_secure() else "https"
c["protocol"] = "https" # if self.request and not self.request.is_secure() else "https"
Review

I think with our current nginx proxy setup we can check first for X-Forwarded-Proto header and otherwise do that. It may be brittle to check that header...

I think with our current nginx proxy setup we can check first for `X-Forwarded-Proto` header and otherwise do that. It may be brittle to check that header...
Review

You're right, it turns out the correct method is to define HOW the fact of https presence should be detected:

https://docs.djangoproject.com/en/5.0/ref/settings/#secure-proxy-ssl-header

You're right, it turns out the correct method is to define HOW the fact of https presence should be detected: https://docs.djangoproject.com/en/5.0/ref/settings/#secure-proxy-ssl-header
Review

Ah awesome! Well spotted

Ah awesome! Well spotted
return c
def get_body(self) -> str:

View file

@ -10,7 +10,7 @@ If you received this email and no longer want a membership, you can ignore it. B
Dansk:
Hej! Så kører medlemsystemet endeligt! Det er mega-fedt, fordi vi længe har haft besvær med manuelle procedurer. Nu har vi flyttet medlemsdata over på members.data.coop, og betalingen fungerer. Vi kan dermed fremover arbejde stille og roligt på at integrere systemet, så man kan styre sine services via medlemssystemet.
Hej! Så kører medlemsystemet endeligt! Det er mega-fedt, fordi vi længe har haft besvær med manuelle procedurer. Nu har vi flyttet medlemsdata over på member.data.coop, og betalingen fungerer. Vi kan dermed fremover arbejde stille og roligt på at integrere systemet, så man kan styre sine services via medlemssystemet.
Hvis du ikke længere vil være medlem, kan du ignorere mailen her; men du må meget gerne informere os via board@data.coop, så vi kan slette evt. personlige data og services, du har kørende på dit tidligere medlemskab.