def fillwith(self): self.short_refname = self.refname if self.refname and '/' in self.refname: self.short_refname = self.refname[self.refname.rfind('/')+1:] self.repo = RepoManager.get_repo_by_id(self.repo_id) self.committer_userprofile = GsuserManager.get_userprofile_by_name(self.committer) self.author_userprofile = GsuserManager.get_userprofile_by_name(self.author)
def fillwith(self): self.short_refname = self.refname if self.refname and '/' in self.refname: self.short_refname = self.refname[self.refname.rfind('/') + 1:] self.repo = RepoManager.get_repo_by_id(self.repo_id) self.committer_userprofile = GsuserManager.get_userprofile_by_name( self.committer) self.author_userprofile = GsuserManager.get_userprofile_by_name( self.author)
def unwatch(request, user_name): gsuserprofile = GsuserManager.get_userprofile_by_name(user_name) if gsuserprofile is None: message = u'用户不存在' return json_failed(404, message) if not RepoManager.unwatch_user(request.userprofile, gsuserprofile): message = u'取消关注失败,可能用户未被关注' return json_failed(500, message) return json_success(u'成功取消关注用户 %s' % user_name)
def watch(request, user_name): gsuserprofile = GsuserManager.get_userprofile_by_name(user_name) if gsuserprofile is None: message = u'用户不存在' return json_failed(404, message) if not RepoManager.watch_user(request.userprofile, gsuserprofile): message = u'关注失败,关注数量超过限制或者用户不允许关注' return json_failed(500, message) return json_success(u'成功关注用户 %s' % user_name)
def unwatch(request, user_name): gsuserprofile = GsuserManager.get_userprofile_by_name(user_name) if gsuserprofile is None: message = u'用户不存在' return json_failed(404, message) if not RepoManager.unwatch_user(request.userprofile, gsuserprofile): message = u'取消关注失败,可能用户未被关注' return json_failed(500, message) return json_success(u'成功取消关注用户 %s' % user_name)
def watch(request, user_name): gsuserprofile = GsuserManager.get_userprofile_by_name(user_name) if gsuserprofile is None: message = u'用户不存在' return json_failed(404, message) if not RepoManager.watch_user(request.userprofile, gsuserprofile): message = u'关注失败,关注数量超过限制或者用户不允许关注' return json_failed(500, message) return json_success(u'成功关注用户 %s' % user_name)
def add_teamMember_by_username(self, teamUser, username): member_userprofile = GsuserManager.get_userprofile_by_name(username) return self.add_teamMember_by_userprofile(teamUser, member_userprofile)