Skip to content

Commit 3e7863b

Browse files
fix(enterprise):ENT-11235:Updated schema ,fixed errors and update related tests for EnterpriseCustomerAdmin
ENT-11235: update schema fix(enterprise): ENT-11235 fix failures after admin invite metadata changes test(enterprise): ENT-11235 Add admin invite timestamps and fix support users serialization
1 parent 4c49bfb commit 3e7863b

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

enterprise/migrations/0243_enterprisecustomeradmin_invited_date_and_more.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ class Migration(migrations.Migration):
1414
model_name="enterprisecustomeradmin",
1515
name="invited_date",
1616
field=models.DateTimeField(
17-
blank=True,
18-
help_text="Timestamp when the admin was invited.",
19-
null=True
17+
blank=True, help_text="Timestamp when the admin was invited.", null=True
2018
),
2119
),
2220
migrations.AddField(

enterprise/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3976,6 +3976,12 @@ class PendingEnterpriseCustomerAdminUser(TimeStampedModel):
39763976
help_text="Timestamp when the admin invite was created."
39773977
)
39783978

3979+
invited_date = models.DateTimeField(
3980+
null=True,
3981+
blank=True,
3982+
help_text="Timestamp when the admin invite was created."
3983+
)
3984+
39793985
class Meta:
39803986
app_label = 'enterprise'
39813987
ordering = ['created']
@@ -5016,6 +5022,7 @@ class EnterpriseCustomerAdmin(TimeStampedModel):
50165022
blank=True,
50175023
help_text="Timestamp when the admin was invited."
50185024
)
5025+
50195026
joined_date = models.DateTimeField(
50205027
null=True,
50215028
blank=True,

enterprise/signals.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from django.db.models.signals import post_delete, post_save, pre_save
1010
from django.dispatch import receiver
1111
from django.utils.timezone import now
12+
from django.utils.timezone import now
1213

1314
from enterprise import models, roles_api
1415
from enterprise.api import activate_admin_permissions
@@ -18,6 +19,10 @@
1819
EnterpriseCustomerAdmin,
1920
PendingEnterpriseCustomerAdminUser,
2021
)
22+
from enterprise.models import (
23+
EnterpriseCustomerAdmin,
24+
PendingEnterpriseCustomerAdminUser,
25+
)
2126
from enterprise.tasks import create_enterprise_enrollment
2227
from enterprise.utils import (
2328
NotConnectedToOpenEdX,
@@ -447,7 +452,7 @@ def generate_default_orchestration_record_display_name(sender, instance, **kwarg
447452
instance.display_name = f'SSO-config-{instance.identity_provider}-{num_records_for_customer + 1}'
448453

449454
@receiver(post_save, sender=EnterpriseCustomerAdmin)
450-
def populate_admin_onboarding_metadata(sender, instance, created, **kwargs): # pylint: disable=unused-argument
455+
def populate_admin_onboarding_metadata(sender, instance, created, **kwargs):
451456
"""
452457
Populate joined_date and invited metadata for enterprise admins.
453458
"""

0 commit comments

Comments
 (0)