Skip to content

Commit 09f7333

Browse files
author
Pranshu
committed
[fix] Removed verb field from DB #334
Removed verb field from DB, verb now updates from config from NOTIFICATION_TYPES. Fixes #334
1 parent 90202be commit 09f7333

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

openwisp_notifications/base/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ def verb(self):
107107
try:
108108
config = get_notification_configuration(self.type)
109109
except (NotificationRenderException, TypeError) as e:
110-
logger.warning(
111-
"Could not get notification config for type %s: %s", self.type, e
110+
logger.error(
111+
"Couldn't get notification config for type %s : %s", self.type, e
112112
)
113-
return self.__dict__.get("verb") or config.get("verb")
113+
return config.get("verb") or self.__dict__.get("verb")
114114

115115
@verb.setter
116116
def verb(self, value):

openwisp_notifications/migrations/0012_alter_notification_verb_nullable.py renamed to openwisp_notifications/migrations/0012_remove_notification_verb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ class Migration(migrations.Migration):
1010
]
1111

1212
operations = [
13-
migrations.AlterField(
13+
migrations.RemoveField(
1414
model_name="notification",
1515
name="verb",
16-
field=models.CharField(max_length=255, null=True, blank=True),
1716
),
1817
]

0 commit comments

Comments
 (0)