diff --git a/rhodecode/model/comment.py b/rhodecode/model/comment.py --- a/rhodecode/model/comment.py +++ b/rhodecode/model/comment.py @@ -63,6 +63,7 @@ class ChangesetCommentsModel(BaseModel): :param f_path: :param line_no: """ + if text: repo = Repository.get(repo_id) cs = repo.scm_instance.get_changeset(revision) @@ -78,7 +79,6 @@ class ChangesetCommentsModel(BaseModel): self.sa.add(comment) self.sa.flush() - # make notification line = '' if line_no: diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -299,7 +299,7 @@ class User(Base, BaseModel): user_followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_user_id==User.user_id', cascade='all') repo_to_perm = relationship('UserRepoToPerm', primaryjoin='UserRepoToPerm.user_id==User.user_id', cascade='all') repo_group_to_perm = relationship('UserRepoGroupToPerm', primaryjoin='UserRepoGroupToPerm.user_id==User.user_id', cascade='all') - + group_member = relationship('UsersGroupMember', cascade='all') notifications = relationship('UserNotification',) @@ -967,7 +967,7 @@ class UsersGroupToPerm(Base, BaseModel): __tablename__ = 'users_group_to_perm' __table_args__ = ( UniqueConstraint('users_group_id', 'permission_id',), - {'extend_existing': True, 'mysql_engine':'InnoDB', + {'extend_existing': True, 'mysql_engine':'InnoDB', 'mysql_charset': 'utf8'} ) users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) @@ -982,7 +982,7 @@ class UserRepoGroupToPerm(Base, BaseMode __tablename__ = 'user_repo_group_to_perm' __table_args__ = ( UniqueConstraint('user_id', 'group_id', 'permission_id'), - {'extend_existing': True, 'mysql_engine':'InnoDB', + {'extend_existing': True, 'mysql_engine':'InnoDB', 'mysql_charset': 'utf8'} ) @@ -1017,8 +1017,8 @@ class UsersGroupRepoGroupToPerm(Base, Ba class Statistics(Base, BaseModel): __tablename__ = 'statistics' __table_args__ = ( - UniqueConstraint('repository_id'), - {'extend_existing': True, 'mysql_engine':'InnoDB', + UniqueConstraint('repository_id'), + {'extend_existing': True, 'mysql_engine':'InnoDB', 'mysql_charset': 'utf8'} ) stat_id = Column("stat_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py --- a/rhodecode/model/user.py +++ b/rhodecode/model/user.py @@ -526,7 +526,7 @@ class UserModel(BaseModel): .join((UsersGroupMember, UsersGroupRepoGroupToPerm.users_group_id == UsersGroupMember.users_group_id))\ .filter(UsersGroupMember.user_id == uid)\ .all() - + for perm in user_repo_group_perms_from_users_groups: g_k = perm.UsersGroupRepoGroupToPerm.group.group_name print perm, g_k diff --git a/rhodecode/templates/admin/repos/repo_edit_perms.html b/rhodecode/templates/admin/repos/repo_edit_perms.html --- a/rhodecode/templates/admin/repos/repo_edit_perms.html +++ b/rhodecode/templates/admin/repos/repo_edit_perms.html @@ -122,7 +122,7 @@ YUE.onDOMReady(function () { ${c.users_groups_array|n}, "${_('Group')}", "${_('members')}" - ); + ); }); diff --git a/rhodecode/templates/admin/repos_groups/repos_group_edit_perms.html b/rhodecode/templates/admin/repos_groups/repos_group_edit_perms.html --- a/rhodecode/templates/admin/repos_groups/repos_group_edit_perms.html +++ b/rhodecode/templates/admin/repos_groups/repos_group_edit_perms.html @@ -111,7 +111,7 @@ YUE.onDOMReady(function () { ${c.users_groups_array|n}, "${_('Group')}", "${_('members')}" - ); + ); }); diff --git a/rhodecode/templates/index_base.html b/rhodecode/templates/index_base.html --- a/rhodecode/templates/index_base.html +++ b/rhodecode/templates/index_base.html @@ -13,7 +13,7 @@ ${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository',parent_group=c.group.group_id))} %else: ${h.link_to(_('ADD REPOSITORY'),h.url('admin_settings_create_repository'))} - %endif + %endif %endif diff --git a/rhodecode/tests/functional/test_changeset_comments.py b/rhodecode/tests/functional/test_changeset_comments.py --- a/rhodecode/tests/functional/test_changeset_comments.py +++ b/rhodecode/tests/functional/test_changeset_comments.py @@ -49,7 +49,7 @@ class TestChangeSetCommentsController(Te notification = Notification.query().all()[0] ID = ChangesetComment.query().first().comment_id - self.assertEqual(notification.type_, + self.assertEqual(notification.type_, Notification.TYPE_CHANGESET_COMMENT) sbj = (u'/vcs_test_hg/changeset/' '27cd5cce30c96924232dffcd24178a07ffeb5dfc#comment-%s' % ID) @@ -86,7 +86,7 @@ class TestChangeSetCommentsController(Te notification = Notification.query().all()[0] ID = ChangesetComment.query().first().comment_id - self.assertEqual(notification.type_, + self.assertEqual(notification.type_, Notification.TYPE_CHANGESET_COMMENT) sbj = (u'/vcs_test_hg/changeset/' '27cd5cce30c96924232dffcd24178a07ffeb5dfc#comment-%s' % ID)