Notifications can target robots, but the model did not reflect that

This fixes a breakage when deleting robots that have notifications targeting them.
This commit is contained in:
Joseph Schorr 2018-05-15 16:15:34 -04:00
parent 0c3b6d5b1a
commit f5fafc480f
2 changed files with 27 additions and 2 deletions

View file

@ -1033,7 +1033,7 @@ class NotificationKind(BaseModel):
class Notification(BaseModel):
uuid = CharField(default=uuid_generator, index=True)
kind = ForeignKeyField(NotificationKind)
target = QuayUserField(index=True)
target = QuayUserField(index=True, allows_robots=True)
metadata_json = TextField(default='{}')
created = DateTimeField(default=datetime.now, index=True)
dismissed = BooleanField(default=False)