diff --git a/common/djangoapps/third_party_auth/migrations/0007_samlproviderconfig_was_valid_at.py b/common/djangoapps/third_party_auth/migrations/0007_samlproviderconfig_was_valid_at.py new file mode 100644 index 0000000000..06bc446277 --- /dev/null +++ b/common/djangoapps/third_party_auth/migrations/0007_samlproviderconfig_was_valid_at.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2022-03-21 14:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('third_party_auth', '0006_auto_20220314_1551'), + ] + + operations = [ + migrations.AddField( + model_name='samlproviderconfig', + name='was_valid_at', + field=models.DateTimeField(blank=True, help_text='Timestamped field that indicates a user has successfully logged in using this configuration at least once.', null=True), + ), + ] diff --git a/common/djangoapps/third_party_auth/models.py b/common/djangoapps/third_party_auth/models.py index 1421767cb8..9686a756e2 100644 --- a/common/djangoapps/third_party_auth/models.py +++ b/common/djangoapps/third_party_auth/models.py @@ -700,6 +700,14 @@ class SAMLProviderConfig(ProviderConfig): blank=True, ) + was_valid_at = models.DateTimeField( + blank=True, + null=True, + help_text=( + "Timestamped field that indicates a user has successfully logged in using this configuration at least once." + ) + ) + def clean(self): """ Standardize and validate fields """ super().clean()