comparison rhodecode/model/notification.py @ 2149:50aa7cb78cfe beta

Mysql fixes - force INNODB engine - set utf8 charset - fix convert_unicode flag in .ini files - fix constraints and FK
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 21 Mar 2012 19:19:00 +0200
parents 8ecfed1d8f8b
children a27e4d44237e
comparison
equal deleted inserted replaced
2148:ad127a5cef73 2149:50aa7cb78cfe
46 return self._get_instance(User, user, callback=User.get_by_username) 46 return self._get_instance(User, user, callback=User.get_by_username)
47 47
48 def __get_notification(self, notification): 48 def __get_notification(self, notification):
49 if isinstance(notification, Notification): 49 if isinstance(notification, Notification):
50 return notification 50 return notification
51 elif isinstance(notification, int): 51 elif isinstance(notification, (int, long)):
52 return Notification.get(notification) 52 return Notification.get(notification)
53 else: 53 else:
54 if notification: 54 if notification:
55 raise Exception('notification must be int or Instance' 55 raise Exception('notification must be int, long or Instance'
56 ' of Notification got %s' % type(notification)) 56 ' of Notification got %s' % type(notification))
57 57
58 def create(self, created_by, subject, body, recipients=None, 58 def create(self, created_by, subject, body, recipients=None,
59 type_=Notification.TYPE_MESSAGE, with_email=True, 59 type_=Notification.TYPE_MESSAGE, with_email=True,
60 email_kwargs={}): 60 email_kwargs={}):