Refactor and enhance device management and authentication features
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 4m12s

- Updated the `reverse_dhivehi_string` function to correct the range for combining characters.
- Added new device handling in the health check view and integrated the `add_new_devices_to_omada` task.
- Improved date handling in `CreateTemporaryUserView` to ensure proper string conversion.
- Enhanced OTP sending by converting mobile numbers to strings.
- Implemented MAC address validation in the `Device` model using a custom validator.
- Removed unnecessary fields from the `CreateDeviceSerializer`.
- Normalized MAC address format in the `DeviceListCreateAPIView`.
- Updated the `djangopasswordlessknox` package to improve code consistency and readability.
- Added migration to enforce MAC address validation in the database.
This commit is contained in:
2025-04-25 14:37:27 +05:00
parent 0f19f0c15c
commit 83db42cc60
24 changed files with 475 additions and 209 deletions

View File

@ -10,7 +10,6 @@ import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
@ -19,25 +18,47 @@ class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
name='CallbackToken',
name="CallbackToken",
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('is_active', models.BooleanField(default=True)),
('to_alias', models.CharField(blank=True, max_length=40)),
('to_alias_type', models.CharField(blank=True, max_length=20)),
('key', models.CharField(default=djangopasswordlessknox.models.generate_numeric_token, max_length=6, unique=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
(
"id",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
unique=True,
),
),
("created_at", models.DateTimeField(auto_now_add=True)),
("is_active", models.BooleanField(default=True)),
("to_alias", models.CharField(blank=True, max_length=40)),
("to_alias_type", models.CharField(blank=True, max_length=20)),
(
"key",
models.CharField(
default=djangopasswordlessknox.models.generate_numeric_token,
max_length=6,
unique=True,
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
],
options={
'verbose_name': 'Callback Token',
'abstract': False,
'ordering': ['-id'],
'get_latest_by': 'created_at',
"verbose_name": "Callback Token",
"abstract": False,
"ordering": ["-id"],
"get_latest_by": "created_at",
},
),
migrations.AlterUniqueTogether(
name='callbacktoken',
unique_together=set([('key', 'is_active')]),
name="callbacktoken",
unique_together=set([("key", "is_active")]),
),
]