Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/npm-d3ece3eced
Browse files Browse the repository at this point in the history
  • Loading branch information
kuboschek authored Oct 22, 2024
2 parents 4fa5e70 + 74d1cec commit c808fb9
Show file tree
Hide file tree
Showing 12 changed files with 411 additions and 346 deletions.
39 changes: 20 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM alpine/git:2.45.2 as version
FROM alpine/git:v2.26.2-amd64 AS version


ADD .git .git
RUN git describe --always > /PORTAL_VERSION
RUN echo "Saved version file containing '$(cat /PORTAL_VERSION)'"

# image for building node dependencies
FROM node:18-alpine as frontend
FROM node:16-alpine AS frontend

RUN apk add --no-cache \
git
Expand Down Expand Up @@ -68,40 +69,40 @@ COPY --from=frontend /app/webpack-stats.json /app/webpack-stats.json
COPY --from=frontend /app/assets/bundles /app/assets/bundles/

# default settings are in MemberManagement
ENV DJANGO_SETTINGS_MODULE "MemberManagement.docker_settings"
ENV DJANGO_SETTINGS_MODULE="MemberManagement.docker_settings"

### ALL THE CONFIGURATION

# disable / enable the devel warning shown on the page
ENV DJANGO_ENABLE_DEVEL_WARNING "1"
ENV DJANGO_ENABLE_DEVEL_WARNING="1"

# The secret key used for django
ENV DJANGO_SECRET_KEY ""
ENV DJANGO_SECRET_KEY=""

# A comma-seperated list of allowed hosts
ENV DJANGO_ALLOWED_HOSTS "localhost"
ENV DJANGO_CSRF_ORIGINS "http://localhost:8000"
ENV DJANGO_ALLOWED_HOSTS="localhost"
ENV DJANGO_CSRF_ORIGINS="http://localhost:8000"

# Database settings
## Use SQLITE out of the box
ENV DJANGO_DB_ENGINE "django.db.backends.sqlite3"
ENV DJANGO_DB_NAME "/data/MemberManagment.db"
ENV DJANGO_DB_USER ""
ENV DJANGO_DB_PASSWORD ""
ENV DJANG_DB_HOST ""
ENV DJANGO_DB_PORT ""
ENV DJANGO_DB_ENGINE="django.db.backends.sqlite3"
ENV DJANGO_DB_NAME="/data/MemberManagment.db"
ENV DJANGO_DB_USER=""
ENV DJANGO_DB_PASSWORD=""
ENV DJANG_DB_HOST=""
ENV DJANGO_DB_PORT=""

# Stripe keys -- required
ENV STRIPE_SECRET_KEY ""
ENV STRIPE_PUBLISHABLE_KEY ""
ENV STRIPE_SECRET_KEY=""
ENV STRIPE_PUBLISHABLE_KEY=""

ENV FINALIZE_AUTOMATICALLY "1"
ENV FINALIZE_AUTOMATICALLY="1"

# GSuite Auth file should be in the data volume
ENV GSUITE_AUTH_FILE /data/credentials.json
ENV GSUITE_AUTH_FILE=/data/credentials.json

# Raven -- optional
ENV DJANGO_RAVEN_DSN ""
ENV DJANGO_RAVEN_DSN=""

# Collect all the static files at build time
RUN DJANGO_SECRET_KEY=setup python manage.py collectstatic --noinput
Expand All @@ -113,4 +114,4 @@ EXPOSE 80
ENTRYPOINT ["/app/docker/entrypoint.sh"]
CMD ["uvicorn", "MemberManagement.asgi:application", "--host", "0.0.0.0", "--port", "80"]

COPY --from=version /PORTAL_VERSION /app/PORTAL_VERSION
COPY --from=version /PORTAL_VERSION /app/PORTAL_VERSION
1 change: 1 addition & 0 deletions MemberManagement/docker_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Django Docker settings for MemberManagement project.
Reads all relevant setting from the environment
"""

from .settings import *

# No Debugging
Expand Down
2 changes: 1 addition & 1 deletion alumni/admin/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def makeHeaderCell(field):

# Write each of the rows
copy = queryset.all()
for (raw, row) in zip(copy, queryset.values_list(*field_names)):
for raw, row in zip(copy, queryset.values_list(*field_names)):

def makeCell(prop):
try:
Expand Down
2 changes: 1 addition & 1 deletion alumni/fields/tier.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TierField(CustomTextChoiceField):

@staticmethod
def get_description(value):
for (k, v) in TierField.CHOICES:
for k, v in TierField.CHOICES:
if k == value:
return v

Expand Down
2 changes: 1 addition & 1 deletion alumni/tests/test_002_admin_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def test_export(self) -> None:
len(EXPECT_EXPORT),
"check that the workbook contains the sheet number of columns",
)
for (i, (got, expected)) in enumerate(zip(values, EXPECT_EXPORT)):
for i, (got, expected) in enumerate(zip(values, EXPECT_EXPORT)):
self.assertListEqual(
got, expected, "check that column {} is correct".format(i)
)
9 changes: 4 additions & 5 deletions alumni/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
class ParsingCallback(Protocol):
"""A callback for parsing"""

def __call__(self, *args: str) -> Any:
...
def __call__(self, *args: str) -> Any: ...


class CSVParser(object):
Expand Down Expand Up @@ -133,7 +132,7 @@ def parse(

# check that the values are of the correct length
count = len(fields)
for (i, v) in enumerate(values):
for i, v in enumerate(values):
if len(v) != count:
raise Exception(
"Malformed values: Index {} is not of expected length".format(i)
Expand All @@ -145,11 +144,11 @@ def parse(
# prepare a list of results
results: List[Dict[str, Any]] = [{} for _ in values]

for (target, idxs) in indexes.items():
for target, idxs in indexes.items():
mapper = mappers[target]

# apply the mapper to each target and save it!
for (index, value) in enumerate(values):
for index, value in enumerate(values):
params: Iterable[str] = map(lambda i: value[i], idxs)
results[index][target] = mapper(*params)

Expand Down
6 changes: 3 additions & 3 deletions donation_receipts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def download_receipt(request, receipt_id):
)

response = FileResponse(receipt.receipt_pdf)
response[
"Content-Disposition"
] = f"filename=Zuwendungsbestätigung vom {receipt.received_on}.pdf"
response["Content-Disposition"] = (
f"filename=Zuwendungsbestätigung vom {receipt.received_on}.pdf"
)

return response

Expand Down
6 changes: 3 additions & 3 deletions payments/tests/test_040_upgrade_noop.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def setUp(self) -> None:
super().setUp()

self.start_tier: str = self.user.alumni.membership.tier
self.start_subscription: Optional[
str
] = self.user.alumni.subscription.subscription
self.start_subscription: Optional[str] = (
self.user.alumni.subscription.subscription
)
self.start_time: datetime = self.user.alumni.subscription.start
self.end_time: Optional[datetime] = self.user.alumni.subscription.end

Expand Down
Loading

0 comments on commit c808fb9

Please sign in to comment.