Skip to content

Commit

Permalink
Merge pull request #10 from NatLibFi/emails_fix
Browse files Browse the repository at this point in the history
disabled sorting+reverse emails.csv
  • Loading branch information
natlibfi-psams authored Jul 3, 2024
2 parents eb105a3 + 09aad53 commit f969a0c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions municipalities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ def indexed_municipalities():
i += 1
return munis


def index_to_email(index):
def index_to_name(index):
return municipalities[index][0]


def index_to_name(index):
def index_to_email(index):
return municipalities[index][1]


def get_emails():
with open(app.config["EMAILS_CSV"], encoding="utf-8", newline="") as csvfile:
email_reader = csv.reader(
Expand All @@ -36,12 +33,13 @@ def get_emails():
)
emails = []
for row in email_reader:
email = row[0]
name = row[1]
name = row[0]
email = row[1]
emails.append((email, name))

# Sort by the second element in a list of tuples because that's where the municipality names are
emails = sorted(emails, key=lambda x: x[1])
######
# Sorthing happens by another means: EKIR-XXX
# Sort by the second element in a list of tuples because that's where the municipality names are
# emails = sorted(emails, key=lambda x: x[1])

# Decorate the emails with some custom values that aren't municipalities
## emails.append(
Expand Down

0 comments on commit f969a0c

Please sign in to comment.