-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update imports in API models to include UserModSettings Add migration for UserModSettings model
- Loading branch information
Showing
4 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 5.0.6 on 2024-05-19 19:15 | ||
|
||
import django.db.models.deletion | ||
import pydis_site.apps.api.models.mixins | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0096_merge_0093_user_alts_0095_user_display_name'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='UserModSettings', | ||
fields=[ | ||
('moderator', models.OneToOneField(help_text='The moderator for whom these settings belong to', on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='mod_settings', serialize=False, to='api.user')), | ||
('pings_disabled_until', models.DateTimeField(help_text='Date and time that moderation pings are disabled until', null=True)), | ||
('pings_schedule_start', models.TimeField(help_text='UTC time that the moderator wishes to receive pings from', null=True)), | ||
('pings_schedule_end', models.DurationField(help_text='Duration after the schedule start time the moderator wishes to receive pings', null=True)), | ||
], | ||
bases=(pydis_site.apps.api.models.mixins.ModelReprMixin, models.Model), | ||
), | ||
migrations.AddConstraint( | ||
model_name='usermodsettings', | ||
constraint=models.CheckConstraint(check=models.Q(models.Q(('pings_schedule_end__isnull', True), ('pings_schedule_start__isnull', True)), models.Q(('pings_schedule_end__isnull', False), ('pings_schedule_start__isnull', False)), _connector='OR'), name='complete_pings_schedule'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,6 @@ | |
Reminder, | ||
Role, | ||
User, | ||
UserAltRelationship | ||
UserAltRelationship, | ||
UserModSettings | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters