physics_workload.app.management.commands.makestaff

Attributes

Classes

Command

Management command that makes a given user account an active member of staff.

Functions

email_type(→ str)

Checks a string is an email addresses.

Module Contents

physics_workload.app.management.commands.makestaff.RE_EMAIL
physics_workload.app.management.commands.makestaff.email_type(value: str) str[source]

Checks a string is an email addresses.

Parameters:

value – The string to check.

Raises:

ArgumentTypeError – If it’s not a valid email address.

Returns:

The string, if it’s correct.

class physics_workload.app.management.commands.makestaff.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: django.core.management.base.BaseCommand

Management command that makes a given user account an active member of staff.

help = 'Registers a given email as staff for the site.'
add_arguments(parser: argparse.ArgumentParser)[source]

Adds the positional argument for email, and flag for superuser status.

Parameters:

parser – The argument parser object.

handle(*args: str, **options: Unpack[str | bool])[source]

The actual logic of the command. Subclasses must implement this method.