diff --git a/data/database.py b/data/database.py index fe59c9171..47bd79fc2 100644 --- a/data/database.py +++ b/data/database.py @@ -774,7 +774,7 @@ class LogEntry(BaseModel): (('repository', 'datetime', 'kind'), False), ) -class Message(BaseModel): +class Messages(BaseModel): content = TextField() class RepositoryActionCount(BaseModel): diff --git a/data/model/message.py b/data/model/message.py index 6fec3a73f..779595746 100644 --- a/data/model/message.py +++ b/data/model/message.py @@ -1,12 +1,12 @@ -from data.database import Message +from data.database import Messages def get_messages(): messages = [] - for message in Message.select(): + for message in Messages.select(): messages.append({'id': message.id, 'content': message.content}) return messages def create(messages): for message in messages: - Message.create(content=message['content']) \ No newline at end of file + Messages.create(content=message['content']) \ No newline at end of file diff --git a/static/js/directives/quay-message-bar.js b/static/js/directives/quay-message-bar.js index 4c05893b9..04e94dbd7 100644 --- a/static/js/directives/quay-message-bar.js +++ b/static/js/directives/quay-message-bar.js @@ -11,7 +11,11 @@ angular.module('quay').directive('quayMessageBar', function () { scope: {}, controller: function ($scope, $element, ApiService) { $scope.messages = []; - ApiService.getMessages().then(function(data){ $scope.messages = data['messages'] || []; }); + try { + ApiService.getMessages().then(function (data) { + $scope.messages = data['messages'] || []; + }); + } } }; });