diff --git a/certego_saas/apps/notifications/migrations/0004_for_user_blank.py b/certego_saas/apps/notifications/migrations/0004_for_user_blank.py new file mode 100644 index 0000000..a9b6d76 --- /dev/null +++ b/certego_saas/apps/notifications/migrations/0004_for_user_blank.py @@ -0,0 +1,23 @@ +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("certego_saas_notifications", "0003_for_user"), + ] + + operations = [ + migrations.AlterField( + model_name="notification", + name="for_user", + field=models.ForeignKey( + settings.AUTH_USER_MODEL, + related_name="notifications", + help_text="If the field is empty, the notification is for everyone; otherwise only for the specified user", + null=True, + blank=True, + on_delete=models.CASCADE, + ), + ), + ] diff --git a/certego_saas/apps/notifications/models.py b/certego_saas/apps/notifications/models.py index bdb21b8..fecfa57 100644 --- a/certego_saas/apps/notifications/models.py +++ b/certego_saas/apps/notifications/models.py @@ -29,6 +29,7 @@ class Notification(TimestampedModel, AppSpecificModel): help_text="If the field is empty, the notification is for everyone; otherwise only for the specified user", null=True, on_delete=models.CASCADE, + blank=True, ) def is_read_by_user(self, user) -> bool: diff --git a/certego_saas/apps/organization/organization.py b/certego_saas/apps/organization/organization.py index 8e1d591..6d9f94c 100644 --- a/certego_saas/apps/organization/organization.py +++ b/certego_saas/apps/organization/organization.py @@ -68,7 +68,7 @@ def create(cls, name: str, owner: "User"): org = cls.objects.create(name=name) membership = Membership.objects.create( - user=owner, organization=org, is_owner=True + user=owner, organization=org, is_owner=True, is_admin=True ) org.members.add(membership) org.save() diff --git a/certego_saas/version.py b/certego_saas/version.py index b90c97e..2400ae8 100644 --- a/certego_saas/version.py +++ b/certego_saas/version.py @@ -1 +1 @@ -VERSION = "0.7.1" +VERSION = "0.7.2"