EighthSignup

Qualified name: intranet.apps.eighth.models.EighthSignup

class intranet.apps.eighth.models.EighthSignup(*args, **kwargs)[source]

Bases: AbstractBaseEighthModel

Represents a signup/membership in an eighth period activity. .. attribute:: user

The User who has signed up.

scheduled_activity

The EighthScheduledActivity for which the user has signed up.

after_deadline

Whether the signup was after deadline.

previous_activity_name

The name of the activity the student was previously signed up for (used for passes)

previous_activity_sponsors

The sponsors of the activity the student was previously signed up for.

pass_accepted

Whether the pass was accepted

was_absent

Whether the student was absent.

absence_acknowledged

Whether the student has dismissed the absence notification.

absence_emailed

Whether the student has been emailed about the absence.

Parameters:

Relationship fields:

Parameters:

Methods

accept_pass

Accepts an eighth period pass for the EighthSignup object.

archive_remove_absence

If user was absent, archives the absence.

get_next_by_time

Finds next instance based on time.

get_previous_by_time

Finds previous instance based on time.

has_conflict

Returns True if another EighthSignup object exists for the same user in the same block.

in_clear_absence_period

Returns whether the block for this signup is in the clear absence period.

reject_pass

Rejects an eighth period pass for the EighthSignup object.

remove_signup

Attempts to remove the EighthSignup if the user has permission to do so.

save

save_without_historical_record

Save model without saving a historical record

validate_unique

Checked whether more than one EighthSignup exists for a User on a given EighthBlock.

Attributes

absence_acknowledged

Type: BooleanField

absence_emailed

Type: BooleanField

after_deadline

Type: BooleanField

archived_was_absent

Type: BooleanField

history

id

Type: AutoField

objects

own_signup

Type: BooleanField

pass_accepted

Type: BooleanField

previous_activity_name

Type: CharField

previous_activity_sponsors

Type: CharField

scheduled_activity

Type: ForeignKey to EighthScheduledActivity

scheduled_activity_id

Internal field, use scheduled_activity instead.

time

Type: DateTimeField

user

Type: ForeignKey to User

user_id

Internal field, use user instead.

was_absent

Type: BooleanField

accept_pass()[source]

Accepts an eighth period pass for the EighthSignup object.

archive_remove_absence()[source]

If user was absent, archives the absence.

has_conflict(nocache: bool = False) bool[source]

Returns True if another EighthSignup object exists for the same user in the same block. :param nocache: Whether to explicitly disable caching for this check.

Returns:

Whether there is another EighthSignup for the same user in the same block.

in_clear_absence_period() bool[source]

Returns whether the block for this signup is in the clear absence period. :returns: Whether the block for this signup is in the clear absence period.

reject_pass()[source]

Rejects an eighth period pass for the EighthSignup object.

remove_signup(user: User | None = None, force: bool = False, dont_run_waitlist: bool = False) str[source]

Attempts to remove the EighthSignup if the user has permission to do so. :param user: The user who is attempting to remove the EighthSignup. :param force: Whether to force removal. :param dont_run_waitlist: Whether to skip notifying users on the activity’s waitlist.

Returns:

A message to be displayed to the user indicating successful removal.

save_without_historical_record(*args, **kwargs)

Save model without saving a historical record

Make sure you know what you’re doing before you use this method.

validate_unique(*args, **kwargs)[source]

Checked whether more than one EighthSignup exists for a User on a given EighthBlock.