Skip to content

Commit

Permalink
Merge pull request #1099 from xzzy/master2
Browse files Browse the repository at this point in the history
Fix sync script for staff numbers clearing legitimate numbers
  • Loading branch information
xzzy authored Oct 21, 2024
2 parents c46982a + 7096716 commit 6513a93
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ledger/accounts/management/commands/sync_ad_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def handle(self, *args, **options):
u.first_name = first_name
u.last_name = last_name
u.is_staff = True
u.phone_number = phone
u.mobile_number = mobile
u.staff_phone_number = phone
u.staff_mobile_number = mobile
u.position_title = position_title
u.manager_name = manager_name
u.manager_email = manager_email
Expand Down
26 changes: 26 additions & 0 deletions ledger/accounts/migrations/0039_auto_20241021_1023.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2024-10-21 02:23
from __future__ import unicode_literals

import django.core.files.storage
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('accounts', '0038_auto_20240716_1530'),
]

operations = [
migrations.AddField(
model_name='emailuser',
name='staff_mobile_number',
field=models.CharField(blank=True, max_length=50, null=True, verbose_name='staff mobile number'),
),
migrations.AddField(
model_name='emailuser',
name='staff_phone_number',
field=models.CharField(blank=True, max_length=50, null=True, verbose_name='staff phone number'),
),
]
4 changes: 4 additions & 0 deletions ledger/accounts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ class EmailUser(AbstractBaseUser, PermissionsMixin):
verbose_name="position title", help_text='Automatically synced from AD, please contact service desk to update.')
mobile_number = models.CharField(max_length=50, null=True, blank=True,
verbose_name="mobile number", help_text='')
staff_phone_number = models.CharField(max_length=50, null=True, blank=True,
verbose_name="staff phone number", help_text='')
staff_mobile_number = models.CharField(max_length=50, null=True, blank=True,
verbose_name="staff mobile number", help_text='')
fax_number = models.CharField(max_length=50, null=True, blank=True,
verbose_name="fax number", help_text='')
organisation = models.CharField(max_length=300, null=True, blank=True,
Expand Down

0 comments on commit 6513a93

Please sign in to comment.