Skip to content

Commit ae1fbd6

Browse files
committed
Remove TODOs
1 parent 603240c commit ae1fbd6

18 files changed

+11
-365
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ dist
393393
# vuepress build output
394394
.vuepress/dist
395395

396-
# vuepress v2.x temp and cache directory
396+
# vuepress v2.x temporary and cache directory
397397
.temp
398398

399399
# Docusaurus cache and generated files

backend/donations/models/main.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,6 @@ class Donor(models.Model):
348348

349349
ngo = models.ForeignKey(Ngo, verbose_name=_("NGO"), on_delete=models.SET_NULL, db_index=True, null=True)
350350

351-
# TODO: first name and last name have been swapped
352-
# https://github.com/code4romania/redirectioneaza/issues/269
353351
l_name = models.CharField(verbose_name=_("last name"), blank=True, null=False, default="", max_length=100)
354352
f_name = models.CharField(verbose_name=_("first name"), blank=True, null=False, default="", max_length=100)
355353
initial = models.CharField(verbose_name=_("initials"), blank=True, null=False, default="", max_length=5)

backend/donations/pdf.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from io import BytesIO
66
from typing import Dict
77

8+
from django.templatetags.static import static
89
from pypdf import PdfReader, PdfWriter
910
from reportlab.graphics import renderPDF
1011
from reportlab.lib.pagesizes import A4
@@ -15,13 +16,16 @@
1516
from reportlab.pdfgen.canvas import Canvas
1617
from svglib.svglib import svg2rlg
1718

18-
abs_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
19-
# TODO: we might need to rethink this; we should not hardcode the path to static_extras
20-
font_path = abs_path + "/static_extras/font/opensans.ttf"
21-
pdfmetrics.registerFont(TTFont("OpenSans", font_path))
19+
form_image_path = static("images/formular-2021.jpg")
20+
font_path = static("font/opensans.ttf")
21+
if font_path.startswith("/"):
22+
abs_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
23+
24+
form_image_path = os.path.join(abs_path, form_image_path[1:])
25+
font_path = os.path.join(abs_path, font_path[1:])
2226

2327
default_font_size = 15
24-
form_image_path = abs_path + "/static_extras/images/formular-2021.jpg"
28+
pdfmetrics.registerFont(TTFont("OpenSans", font_path))
2529

2630

2731
def format_ngo_account(ngo_account: str):

backend/donations/views/donations_download.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ def _package_donations(tmp_dir_name: str, donations: QuerySet[Donor], ngo: Ngo,
133133
detailed_address: Dict = _get_address_details(donation_object)
134134
donations_data.append(
135135
{
136-
# TODO: first name and last name have been swapped
137-
# https://github.com/code4romania/redirectioneaza/issues/269
138136
"last_name": donation_object.l_name,
139137
"first_name": donation_object.f_name,
140138
"initial": donation_object.initial,

backend/importer/__init__.py

Whitespace-only changes.

backend/importer/apps.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

backend/importer/extract.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

backend/importer/migrations/0001_initial.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

backend/importer/migrations/0002_alter_importjob_import_type.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

backend/importer/migrations/0003_alter_importjob_csv_file.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

backend/importer/migrations/0004_alter_importjob_options_remove_importjob_csv_file_and_more.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

backend/importer/migrations/0005_delete_importjob.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

backend/importer/migrations/__init__.py

Whitespace-only changes.

backend/importer/tasks/__init__.py

Whitespace-only changes.

backend/importer/tasks/donor_forms.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)