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

Created a check that determines if the CSV has the minimum required info #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

zzamn
Copy link

@zzamn zzamn commented Oct 22, 2024

Running the csvCheck() function specifies where the problematic lines are in the CSV file. It returns a boolean.

Option to return false immediately even if one line is wrong, but its been commented out. So right now it goes through every line, and prints which lines are problematic.

Hope this is alright

It specifies where the problematic lines are in the CSV file.

Option to return false immediately even if one line is wrong.

But its been commented out
@zzamn
Copy link
Author

zzamn commented Oct 22, 2024

NEVER MIND. I DIDN'T DO A CHECK TO SEE IF THE EMAIL IS IN THE RIGHT FORMAT

@zzamn
Copy link
Author

zzamn commented Oct 22, 2024

2 MINUTES

@zzamn zzamn closed this Oct 22, 2024
@zzamn zzamn reopened this Oct 22, 2024
@CloudArtAdmins
Copy link
Collaborator

Haha, we are in no rush here.
This is for long term usage, so no worries.

CloudArtAdmins and others added 4 commits October 22, 2024 13:20
checks if email is of the form [email protected]

Alternate option which checks if email is of form [email protected] has been commented out

also, slightly modified csv_check so that it doesn't only catch empty strings, but also strings ONLY composed of whitespaces
@zzamn
Copy link
Author

zzamn commented Oct 22, 2024

I've added a function is_invalid_email. Which checks if every mail is of the format [email protected] .
If you actually wanted it to be of the format [email protected] , where y can be 'org' or 'com' or anything else, that's also in the code. I just commented it out.

the csv_check function checks if the email is valid using is_invalid email and makes sure that the organization and contact name have at least one character. So, they can't be empty or have ONLY blank spaces.

@zzamn
Copy link
Author

zzamn commented Oct 22, 2024

This is based on the assumption that the Organization, Contact_Name and Contact_Email are the only essential requirements, and Cascadia and Prev_Sponsor are optional.

If that isn't the case, I can easily modify it.

Now that I think about it, I should have asked for clarifications super early on. Sorry if what I wrote wasn't what you were looking for 😅

@CloudArtAdmins
Copy link
Collaborator

You are correct about the required and not fields. So no problem there. If you made them "required" this would be no problem either, anyway.

@CloudArtAdmins
Copy link
Collaborator

CloudArtAdmins commented Oct 23, 2024

Okay, so reviewed it.
We actually need this to just check that an email is in the email field. We do not want to specify that it is a SeaGL domain, because this is for template emails to partners, who are highly unlikely to have a SeaGL email.
Could you modify the email check to not care what the domain is, please?

I think the rest is good, though. So once done, I'll pull this version and test.
If it works, it will be merged.

Now, it doesn't check whether the email is of the seagl format,
But rather if it is in an email format (i.e [email protected])
@zzamn
Copy link
Author

zzamn commented Oct 23, 2024

I updated the is_invalid_email function.

It now checks if email is of the format ' [email protected] ' where:
- len(x), len(y)>0
- len(z)>1
- x can consist of alphanumeric characters , '.' , '_' , '%' , '+' and '-'
- y can consist of alphanumeric characters, '.' and '-'
- z can consist of ONLY alphanumeric characters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants