Skip to content

regrade.py incorrectly identifies usernames with underscores as teams #12423

Description

@srikaaviya

DESCRIPTION:
I found a FIXME in bin/regrade.py (line 216) concerning how the script identifies whether a submission belongs to a user or a team.

Currently, the script uses a heuristic based on the presence of an underscore in the directory name (my_who):

# bin/regrade.py:216-224
# FIXME: This will be incorrect if the username includes an underscore
if '_' not in my_who:
    my_user = my_who
    my_team = ""
    my_is_team = False
else:
    my_user = ""
    my_team = my_who
    my_is_team = True

This logic fails for:
Users with underscores: A user with ID jane_doe will be incorrectly classified as a Team.

PROPOSED FIX:
The script already loads the build configuration (datastore). I plan to use the team_assignment boolean from that config to definitively decide if the folder represents a User or a Team, removing the fragile underscore check.

If you are ok with this approach, I will work on the fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions