##// END OF EJS Templates
db: rename UserFollowing.follows_repo_id to follows_repository_id...
Søren Løvborg -
r6281:2d216fd7 default
parent child Browse files
Show More
@@ -78,8 +78,8 b' class JournalController(BaseController):'
78 78 return groups
79 79
80 80 def _get_journal_data(self, following_repos):
81 repo_ids = [x.follows_repo_id for x in following_repos
82 if x.follows_repo_id is not None]
81 repo_ids = [x.follows_repository_id for x in following_repos
82 if x.follows_repository_id is not None]
83 83 user_ids = [x.follows_user_id for x in following_repos
84 84 if x.follows_user_id is not None]
85 85
@@ -311,7 +311,7 b' class JournalController(BaseController):'
311 311 log.error(traceback.format_exc())
312 312 raise HTTPBadRequest()
313 313
314 repo_id = request.POST.get('follows_repo_id')
314 repo_id = request.POST.get('follows_repository_id')
315 315 if repo_id:
316 316 try:
317 317 self.scm_model.toggle_following_repo(repo_id,
@@ -1021,7 +1021,7 b' class Repository(Base, BaseDbModel):'
1021 1021 stats = relationship('Statistics', cascade='all', uselist=False)
1022 1022
1023 1023 followers = relationship('UserFollowing',
1024 primaryjoin='UserFollowing.follows_repo_id==Repository.repo_id',
1024 primaryjoin='UserFollowing.follows_repository_id==Repository.repo_id',
1025 1025 cascade='all')
1026 1026 extra_fields = relationship('RepositoryField',
1027 1027 cascade="all, delete-orphan")
@@ -2036,7 +2036,7 b' class UserFollowing(Base, BaseDbModel):'
2036 2036
2037 2037 user_following_id = Column(Integer(), primary_key=True)
2038 2038 user_id = Column(Integer(), ForeignKey('users.user_id'), nullable=False)
2039 follows_repo_id = Column("follows_repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=True)
2039 follows_repository_id = Column(Integer(), ForeignKey('repositories.repo_id'), nullable=True)
2040 2040 follows_user_id = Column(Integer(), ForeignKey('users.user_id'), nullable=True)
2041 2041 follows_from = Column(DateTime(timezone=False), nullable=False, default=datetime.datetime.now)
2042 2042
@@ -2047,7 +2047,7 b' class UserFollowing(Base, BaseDbModel):'
2047 2047
2048 2048 @classmethod
2049 2049 def get_repo_followers(cls, repo_id):
2050 return cls.query().filter(cls.follows_repo_id == repo_id)
2050 return cls.query().filter(cls.follows_repository_id == repo_id)
2051 2051
2052 2052
2053 2053 class CacheInvalidation(Base, BaseDbModel):
@@ -241,7 +241,7 b' class ScmModel(BaseModel):'
241 241 def toggle_following_repo(self, follow_repo_id, user_id):
242 242
243 243 f = self.sa.query(UserFollowing) \
244 .filter(UserFollowing.follows_repo_id == follow_repo_id) \
244 .filter(UserFollowing.follows_repository_id == follow_repo_id) \
245 245 .filter(UserFollowing.user_id == user_id).scalar()
246 246
247 247 if f is not None:
@@ -258,7 +258,7 b' class ScmModel(BaseModel):'
258 258 try:
259 259 f = UserFollowing()
260 260 f.user_id = user_id
261 f.follows_repo_id = follow_repo_id
261 f.follows_repository_id = follow_repo_id
262 262 self.sa.add(f)
263 263
264 264 action_logger(UserTemp(user_id),
@@ -451,8 +451,8 b' var _onSuccessFollow = function(target){'
451 451 }
452 452 }
453 453
454 var toggleFollowingRepo = function(target, follows_repo_id){
455 var args = 'follows_repo_id=' + follows_repo_id;
454 var toggleFollowingRepo = function(target, follows_repository_id){
455 var args = 'follows_repository_id=' + follows_repository_id;
456 456 args += '&_authentication_token=' + _authentication_token;
457 457 $.post(TOGGLE_FOLLOW_URL, args, function(data){
458 458 _onSuccessFollow(target);
@@ -23,7 +23,7 b' class TestJournalController(TestControll'
23 23 #
24 24 # response = self.app.post(url(controller='journal',
25 25 # action='toggle_following'),
26 # {'follows_repo_id':repo.repo_id})
26 # {'follows_repository_id':repo.repo_id})
27 27
28 28 def test_start_following_repository(self):
29 29 self.log_user()
General Comments 0
You need to be logged in to leave comments. Login now