Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Aug 26, 2024
1 parent 20a0b7f commit 4b8a5f1
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from zope.interface import alsoProvides

import base64
import csv
from defusedcsv import csv
import logging
import re

Expand All @@ -31,7 +31,7 @@
"newspaper",
"date",
]

REQUIRED = ["email", "channels"]

# @implementer(IPublishTraverse)
class SubscriptionsCSVGet(DataCSVGet):
Expand Down Expand Up @@ -96,9 +96,9 @@ def reply(self):
"imported": 0,
}

# required fields: email, channels
for required in ["email", "channels"]:
if "required" not in rows[0]:
# required fields: (e.g. email, channels)
for required in REQUIRED:
if required not in rows[0]:
res["errored"].append(
translate(
_(
Expand All @@ -120,8 +120,8 @@ def reply(self):
msg = translate(
_(
"invalid_email",
default="[${row}] - row with invalid email",
mapping={"row": i},
default="[${row}] - row with invalid email ${email}",
mapping={"row": i, "email": row.get("email", "")},
),
context=self.request,
)
Expand Down

0 comments on commit 4b8a5f1

Please sign in to comment.