Skip to content

Commit

Permalink
check email_opt_out, inc SIM110
Browse files Browse the repository at this point in the history
  • Loading branch information
james-stevens committed Mar 15, 2023
1 parent d6440dc commit 6bed8be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 1 addition & 4 deletions python/bin/fix_db_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ def type_change(col1, col2):
""" check to see if the column type or size has changed """
if col1["type"] != col2["type"]:
return True
for property in ["size", "null", "default"]:
if not property_same(property, col1, col2):
return True
return False
return any(not property_same(property, col1, col2) for property in ["size", "null", "default"])


parser = argparse.ArgumentParser(description='EPP Jobs Runner')
Expand Down
17 changes: 15 additions & 2 deletions python/librar/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,21 @@ def valid_float(num):
return None


ALL_EMAILS = {
"domain_transferred": True,
"email_changed_warn": True,
"gifted_domain": True,
"password_changed": True,
"payment_done": True,
"receipt": True,
"reminder": True,
}


def valid_email_opt_out(email_opt_out):
return True
if email_opt_out is None or email_opt_out == "":
return True
return all(eml in ALL_EMAILS and ALL_EMAILS[eml] for eml in [x.lower() for x in email_opt_out.split(",")])


def main():
Expand All @@ -253,7 +266,7 @@ def main():
# for code in sys.argv:
# print("SESS",code,is_valid_ses_code(code))
for item in sys.argv[1:]:
print(item, check_domain_name(item))
print(item, valid_email_opt_out(item))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[tool.ruff]
extend-select = ["C4","SIM","TCH"]
line-length = 119
ignore = ["SIM110","SIM105","F403"]
ignore = ["SIM105","F403"]

0 comments on commit 6bed8be

Please sign in to comment.