-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewrite notif logic according to new specs * fix tests and comment out a lot
- Loading branch information
Showing
9 changed files
with
377 additions
and
485 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
from django.contrib import admin | ||
|
||
from user.models import NotificationSetting, NotificationToken, Profile | ||
from user.models import AndroidNotificationToken, IOSNotificationToken, NotificationService, Profile | ||
|
||
|
||
admin.site.register(NotificationToken) | ||
admin.site.register(NotificationSetting) | ||
# custom IOSNotificationToken admin | ||
class IOSNotificationTokenAdmin(admin.ModelAdmin): | ||
list_display = ("token", "user", "is_dev") | ||
|
||
|
||
admin.site.register(IOSNotificationToken, IOSNotificationTokenAdmin) | ||
admin.site.register(AndroidNotificationToken) | ||
admin.site.register(NotificationService) | ||
admin.site.register(Profile) |
64 changes: 64 additions & 0 deletions
64
backend/user/migrations/0010_remove_notificationtoken_user_and_more.py
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,64 @@ | ||
# Generated by Django 5.0.2 on 2024-11-11 05:24 | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("user", "0009_profile_fitness_preferences"), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="notificationtoken", | ||
name="user", | ||
), | ||
migrations.CreateModel( | ||
name="AndroidNotificationToken", | ||
fields=[ | ||
("token", models.CharField(max_length=255, primary_key=True, serialize=False)), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="IOSNotificationToken", | ||
fields=[ | ||
("token", models.CharField(max_length=255, primary_key=True, serialize=False)), | ||
("is_dev", models.BooleanField(default=False)), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="NotificationService", | ||
fields=[ | ||
("name", models.CharField(max_length=255, primary_key=True, serialize=False)), | ||
("enabled_users", models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
migrations.DeleteModel( | ||
name="NotificationSetting", | ||
), | ||
migrations.DeleteModel( | ||
name="NotificationToken", | ||
), | ||
] |
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
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
Oops, something went wrong.