Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "disabled sorting+reverse emails.csv" #11

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions municipalities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ def indexed_municipalities():
i += 1
return munis

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

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


def index_to_name(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 @@ -33,13 +36,12 @@ def get_emails():
)
emails = []
for row in email_reader:
name = row[0]
email = row[1]
email = row[0]
name = row[1]
emails.append((email, name))
######
# 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])

# 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