Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

handle blank lines in roster upload #34

Open
hcientist opened this issue Sep 22, 2022 · 1 comment
Open

handle blank lines in roster upload #34

hcientist opened this issue Sep 22, 2022 · 1 comment
Labels
good first issue Good for newcomers

Comments

@hcientist
Copy link
Contributor

upload student roster should be a bit more robust. apparently even our kind colleagues and collaborators have no compunction about violating the file format and sending us blank lines! 😆

Take a look over here

for name, username, password, grade in reader:
if (name, username, password, grade) == (
"fullname",
"username",
"password",
"grade",
):
continue
try:
user = User.objects.get(username=username)
if user.check_password(password):
response["existing"].append(user)
else:
response["invalid"].append(
{
"name": name,
"username": username,
"password": password,
"grade": grade,
"reason": "Wrong password", # real bad
}
)

@hcientist hcientist added the good first issue Good for newcomers label Sep 22, 2022
@devbazregari
Copy link

hi bro I hope you're doing great. do you want me to don't allow the student to send you blank credentials? like username or grade?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants