recordtransfer.models - Models for recordtransfer app

class recordtransfer.models.User(*args, **kwargs)

Bases: AbstractUser

The main User object used to authenticate users.

gets_submission_email_updates

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gets_notification_emails

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

language

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

phone_number

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

address_line_1

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

address_line_2

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

city

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

province_or_state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

other_province_or_state

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

postal_or_zip_code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

country

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property full_name: str

Return the full name of the user, which is a combination of first and last names.

property has_contact_info: bool

Check if user has complete contact information.

open_upload_sessions() QuerySet

Get the upload sessions this user has open.

An “open” upload session is one in any of these states:

  • CREATED

  • UPLOADING

  • COPYING_IN_PROGRESS

Returns:

The open upload sessions for this user, in no particular order.

open_sessions_within_limit(will_add_new: bool = False) bool

Determine if this user’s total upload session count is within the limit set.

The upload session limit is set by UPLOAD_SESSION_MAX_CONCURRENT_OPEN.

Parameters:

will_add_new – Find whether the current session count PLUS a new one would put the count over the limit. Defaults to False.

Returns:

True if less than or equal to the limit, False if over the limit.

past_password_hashes(limit: int = 5) list

Get the past N hashes of this user’s previous password.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

date_joined

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

first_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_language_display(*, field=<django.db.models.fields.CharField: language>)
get_next_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=True, **kwargs)
get_previous_by_date_joined(*, field=<django.db.models.fields.DateTimeField: date_joined>, is_next=False, **kwargs)
groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

inprogresssubmission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

is_active

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_staff

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_superuser

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

job_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

last_login

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

logentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

password

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

password_history

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

sitesetting_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

submission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

submissiongroup_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

uploadsession_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

user_permissions

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

username

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class recordtransfer.models.PasswordHistory(*args, **kwargs)

Bases: Model

Store a user’s previous password hashes for history validation.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

password

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

changed_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

get_next_by_changed_at(*, field=<django.db.models.fields.DateTimeField: changed_at>, is_next=True, **kwargs)
get_previous_by_changed_at(*, field=<django.db.models.fields.DateTimeField: changed_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
user_id
recordtransfer.models.add_previous_password_to_history(instance: User, **kwargs) None

Handle password history when User password changes.

class recordtransfer.models.SiteSetting(*args, **kwargs)

Bases: Model

A model to store configurable site settings that administrators can modify through the Django admin interface without requiring code changes.

This model supports caching of settings values for improved performance.

Adding a New Setting

To add a new setting to the database, follow these steps:

  1. Add a new entry to the SiteSettingKey enum class:

    Add your new setting key to the SiteSetting enum in recordtransfer/enums.py. The key should be descriptive and follow existing naming conventions (i.e., all uppercase with underscores). Include a SettingKeyMeta with the value type, description, and optional default value.

    Example:

    NEW_SETTING_NAME = SettingKeyMeta(
        SiteSettingType.STR,
        _("Description of what this setting controls."),
        default_value="Default string value",
    )
    
  2. Create a data migration:

    Create a Django data migration to add the setting to the database. The migration should create a new SiteSetting instance with the required fields:

    • key: Must be unique and match the enum name (string)

    • value: The default value as a string (must use the enum’s default_value if available)

    • value_type: Either “int” for integers or “str” for strings

    Example migration for a string setting:

    from django.db import migrations
    
    
    def add_new_setting(apps, schema_editor):
        SiteSetting = apps.get_model("recordtransfer", "SiteSetting")
        SiteSetting.objects.get_or_create(
            key="NEW_SETTING_NAME",
            defaults={"value": "Default string value", "value_type": "str"},
        )
    
    
    class Migration(migrations.Migration):
        dependencies = [
            ("recordtransfer", "XXXX_previous_migration"),
        ]
    
        operations = [
            migrations.RunPython(add_new_setting),
        ]
    
  3. Validation requirements:

    • The key field must be unique across all settings

    • For value_type “int”: the value must be a valid string representation of an integer (e.g., “42”, “-1”, “0”)

    • For value_type “str”: the value can be any string

    • change_date is auto-generated and changed_by does not need to be set

  4. Document the new setting:

    Add an entry for the new setting to docs/admin_guide/site_settings.rst.

Removing a Setting

To remove an existing setting from the database:

  1. Remove the key from the SiteSettingKey enum class:

    Delete the corresponding enum entry from the SiteSetting enum in enums.py.

  2. Create a data migration:

    Create a Django data migration to remove the setting from the database:

    from django.db import migrations
    
    
    def remove_old_setting(apps, schema_editor):
        SiteSetting = apps.get_model("recordtransfer", "SiteSetting")
        SiteSetting.objects.filter(key="OLD_SETTING_NAME").delete()
    
    
    class Migration(migrations.Migration):
        dependencies = [
            ("recordtransfer", "XXXX_previous_migration"),
        ]
    
        operations = [
            migrations.RunPython(remove_old_setting),
        ]
    
  3. Update code references:

    Remove any code that references the old setting key.

  4. Update documentation:

    Remove the setting from docs/admin_guide/site_settings.rst.

Retrieving Settings in Code

Once a setting has been added to the database, retrieve it using the appropriate static method:

  • For string settings:

    value = SiteSetting.get_value_str(SiteSettingKey.SETTING_NAME)
    
  • For integer settings:

    value = SiteSetting.get_value_int(SiteSettingKey.SETTING_NAME)
    
key

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

change_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

changed_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

set_cache(value: str | int | None) None

Cache the value of this setting.

static get_value_str(key: SiteSettingKey) str | None

Get the value of a site setting of type SettingType.STR by its key.

Parameters:

key – The key of the setting to retrieve.

Returns:

The value of the setting as a string, cached if available, or fetched from the database.

Raises:

ValidationError – If the setting is not of type SettingType.STR.

static get_value_int(key: SiteSettingKey) int | None

Get the value of a site setting of type SettingType.INT by its key.

Parameters:

key – The key of the setting to retrieve.

Returns:

The value of the setting as an integer, cached if available, or fetched from the database.

Raises:

ValidationError – If the setting is not of type SettingType.INT.

reset_to_default(user: User | None = None) None

Reset this setting to its default value as defined in the SiteSettingKey enum.

Parameters:

user – The user who initiated the reset operation (optional).

property default_value: str | None

Get the default value for this setting, if available. The default value is defined in the SiteSettingKey enum, in the form of a string.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

changed_by_id
get_next_by_change_date(*, field=<django.db.models.fields.DateTimeField: change_date>, is_next=True, **kwargs)
get_previous_by_change_date(*, field=<django.db.models.fields.DateTimeField: change_date>, is_next=False, **kwargs)
get_value_type_display(*, field=<django.db.models.fields.CharField: value_type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
recordtransfer.models.update_cache_post_save(sender: SiteSetting, instance: SiteSetting, created: bool, **kwargs) None

Update cached value when setting is saved, but not on creation.

class recordtransfer.models.SubmissionGroup(*args, **kwargs)

Bases: Model

Represents a group of submissions.

name

The name of the group

Type:

CharField

description

A description of the group

Type:

TextField

created_by

The user who created the group

Type:

ForeignKey

uuid

A unique ID for the group

Type:

UUIDField

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property number_of_submissions_in_group: int

Get the number of submissions in this group.

get_absolute_url() str

Return the URL to access a detail view of this submission group.

get_delete_url() str

Return the URL to delete this submission group.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

created_by_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
submission_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_reverse_many_to_one_manager() defined below.

class recordtransfer.models.Submission(*args, **kwargs)

Bases: Model

The object that represents a user’s submission, including metadata, and the files they submitted.

submission_date

The date and time the submission was made

Type:

DateTimeField

user

The user who submitted the metadata (and optionally, files)

Type:

User

raw_form

A JSON object containing the submission form data as it was submitted

Type:

JSONField

metadata

Foreign key to a Metadata object. The metadata object is generated from the form metadata, and any defaults that have been set in the settings

Type:

OneToOneField

part_of_group

The group that this submission is a part of

Type:

ForeignKey

upload_session

The upload session associated with this submission. If file uploads are disabled, this will always be NULL/None

Type:

UploadSession

uuid

A unique ID for the submission

Type:

UUIDField

submission_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

raw_form

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

metadata

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

part_of_group

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

upload_session

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property bag_name: str

Get a name suitable for a submission bag.

The bag name contains the username, the date this submission was made, and the title of the metadata. This file name is properly sanitized to be used as a directory or part of a file name.

Raises:

ValueError – If there is no metadata or no user associated with this submission.

property extent_statements: str

Return the first extent statement for this submission.

get_admin_metadata_change_url() str

Get the URL to change the metadata object in the admin.

get_admin_change_url() str

Get the URL to change this object in the admin.

get_admin_report_url() str

Get the URL to generate a report for this object in the admin.

get_admin_zip_url() str

Get the URL to generate a zipped bag for this object in the admin.

make_bag(location: Path, algorithms: Iterable[str] = ('sha512',), file_perms: str = '644') Bag

Create a BagIt bag on the file system for this Submission. Checks the validity of the Bag post-creation to ensure that integrity is maintained. The data payload files come from the UploadSession associated with this submission.

If given a location to an existing Bag, this function will check whether the Bag can be updated in-place. If not, the Bag will be completely re-generated again.

Raises:
  • ValueError – If any required state is incorrect (e.g., no upload session)

  • FileNotFoundError – If any files are missing when copying to temp location

  • FileExistsError – If the Bag at self.location already exists

  • bagit.BagValidationError – If the Bag is created, but it’s invalid

Parameters:
  • location (Path) – The path to make the Bag at

  • algorithms (Iterable[str]) – The checksum algorithms to generate the BagIt bag with

  • file_perms (str) – A string-based octal “chmod” number

remove_bag(location: Path) None

Remove everything in the Bag, including the Bag folder itself.

remove_bag_contents(location: Path) None

Remove everything in the Bag, but not the Bag directory itself.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

get_next_by_submission_date(*, field=<django.db.models.fields.DateTimeField: submission_date>, is_next=True, **kwargs)
get_previous_by_submission_date(*, field=<django.db.models.fields.DateTimeField: submission_date>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

metadata_id
objects = <django.db.models.manager.Manager object>
part_of_group_id
upload_session_id
user_id
class recordtransfer.models.Job(*args, **kwargs)

Bases: Model

A background job executed by an admin user.

class JobStatus(*values)

Bases: TextChoices

The status of the bag’s review.

NOT_STARTED = 'NS'
IN_PROGRESS = 'IP'
COMPLETE = 'CP'
FAILED = 'FD'
uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

start_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

end_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user_triggered

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

job_status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

attached_file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
message_log

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

has_file() bool

Determine if this job has an attached file.

get_file_media_url() str

Generate the media URL to this file.

Raises:

FileNotFoundError if the file does not exist.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

get_job_status_display(*, field=<django.db.models.fields.CharField: job_status>)
get_next_by_start_time(*, field=<django.db.models.fields.DateTimeField: start_time>, is_next=True, **kwargs)
get_previous_by_start_time(*, field=<django.db.models.fields.DateTimeField: start_time>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
user_triggered_id
class recordtransfer.models.InProgressSubmission(*args, **kwargs)

Bases: Model

A submission that is in progress, created when a user saves a submission form.

uuid

A unique ID for the submission

user

The user who is submitting the form

last_updated

The last time the form was updated

current_step

The current step the user is on

step_data

The data contained in the form

title

The accession title of the submission

STEP_CHOICES: ClassVar = [('acceptlegal', 'ACCEPT_LEGAL'), ('contactinfo', 'CONTACT_INFO'), ('sourceinfo', 'SOURCE_INFO'), ('recorddescription', 'RECORD_DESCRIPTION'), ('rights', 'RIGHTS'), ('otheridentifiers', 'OTHER_IDENTIFIERS'), ('groupsubmission', 'GROUP_SUBMISSION'), ('uploadfiles', 'UPLOAD_FILES'), ('finalnotes', 'FINAL_NOTES'), ('review', 'REVIEW')]
uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

last_updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

current_step

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

step_data

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

upload_session

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

reminder_email_sent

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <recordtransfer.managers.InProgressSubmissionManager object>
clean() None

Validate the current step value. This gets called when the model instance is modified through a form.

property upload_session_expires_at: datetime | None

Get the expiration time of the upload session associated with this submission.

property upload_session_expired: bool

Determine if the associated upload session has expired or not.

property upload_session_expires_soon: bool

Determine if the associated upload session is expiring soon or not.

get_resume_url() str

Get the URL to access and resume the in-progress submission.

get_delete_url() str

Get the URL to delete this in-progress submission.

reset_reminder_email_sent() None

Reset the reminder email flag to False, if it isn’t already False.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

get_current_step_display(*, field=<django.db.models.fields.CharField: current_step>)
get_next_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=True, **kwargs)
get_previous_by_last_updated(*, field=<django.db.models.fields.DateTimeField: last_updated>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

upload_session_id
user_id
recordtransfer.models.delete_upload_session_on_delete(sender: InProgressSubmission, instance: InProgressSubmission, **kwargs) None

Delete the upload session for a given in progress submission when it’s deleted.

recordtransfer.models.update_upon_save(sender: InProgressSubmission, instance: InProgressSubmission, **kwargs) None

Update the last upload interaction time of the associated upload session when the InProgressSubmission is saved, and reset the reminder email flag, if an upload session exists.

If only the reminder_email_sent field is being updated, skip touching the upload session to avoid resetting the expiry time.