-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
magsyg
committed
Sep 21, 2023
1 parent
fa831ca
commit 1fd8138
Showing
6 changed files
with
376 additions
and
257 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
Large diffs are not rendered by default.
Oops, something went wrong.
102 changes: 102 additions & 0 deletions
102
backend/samfundet/migrations/0039_alter_notification_options_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,102 @@ | ||
# Generated by Django 4.2.5 on 2023-09-21 17:40 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import jsonfield.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('contenttypes', '0002_remove_content_type_name'), | ||
('samfundet', '0038_alter_user_email'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='notification', | ||
options={'ordering': ('-timestamp',), 'verbose_name': 'Notification', 'verbose_name_plural': 'Notifications'}, | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='action_object_content_type', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notify_action_object', to='contenttypes.contenttype', verbose_name='action object content type'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='action_object_object_id', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='action object object id'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='actor_content_type', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notify_actor', to='contenttypes.contenttype', verbose_name='actor content type'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='actor_object_id', | ||
field=models.CharField(max_length=255, verbose_name='actor object id'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='data', | ||
field=jsonfield.fields.JSONField(blank=True, null=True, verbose_name='data'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='deleted', | ||
field=models.BooleanField(db_index=True, default=False, verbose_name='deleted'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='description', | ||
field=models.TextField(blank=True, null=True, verbose_name='description'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='emailed', | ||
field=models.BooleanField(db_index=True, default=False, verbose_name='emailed'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='level', | ||
field=models.CharField(choices=[('success', 'success'), ('info', 'info'), ('warning', 'warning'), ('error', 'error')], default='info', max_length=20, verbose_name='level'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='public', | ||
field=models.BooleanField(db_index=True, default=True, verbose_name='public'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='recipient', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='recipient'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='target_content_type', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notify_target', to='contenttypes.contenttype', verbose_name='target content type'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='target_object_id', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='target object id'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='timestamp', | ||
field=models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='timestamp'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='unread', | ||
field=models.BooleanField(db_index=True, default=True, verbose_name='unread'), | ||
), | ||
migrations.AlterField( | ||
model_name='notification', | ||
name='verb', | ||
field=models.CharField(max_length=255, verbose_name='verb'), | ||
), | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,8 +120,14 @@ def test_staff_permission_admin_panel(fixture_django_client: Client, fixture_sta | |
def test_staff_object_permission_admin_panel(fixture_django_client: Client, fixture_staff: User): | ||
fixture_django_client.force_login(user=fixture_staff) | ||
|
||
some_user = User.objects.create_user(username='some_user') | ||
other_user = User.objects.create_user(username='other_user') | ||
some_user = User.objects.create_user( | ||
username='some_user', | ||
email='[email protected]', | ||
) | ||
other_user = User.objects.create_user( | ||
username='other_user', | ||
email='[email protected]', | ||
) | ||
|
||
url_some_user = reverse(routes.admin__samfundet_user_change, args=[some_user.id]) | ||
url_other_user = reverse(routes.admin__samfundet_user_change, args=[other_user.id]) | ||
|