##// END OF EJS Templates
implements #193 journal stores information about deleting of repos...
marcink -
r1747:88047154 beta
parent child Browse files
Show More
@@ -384,6 +384,9 def create_repo_fork(form_data, cur_user
384 update_after_clone=update_after_clone)
384 update_after_clone=update_after_clone)
385 action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
385 action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
386 org_repo_name, '', Session)
386 org_repo_name, '', Session)
387
388 action_logger(cur_user, 'user_created_fork:%s' % fork_name,
389 fork_name, '', Session)
387 # finally commit at latest possible stage
390 # finally commit at latest possible stage
388 Session.commit()
391 Session.commit()
389
392
@@ -389,6 +389,7 def action_parser(user_log, feed=False):
389
389
390 action_map = {'user_deleted_repo':(_('[deleted] repository'), None),
390 action_map = {'user_deleted_repo':(_('[deleted] repository'), None),
391 'user_created_repo':(_('[created] repository'), None),
391 'user_created_repo':(_('[created] repository'), None),
392 'user_created_fork':(_('[created] repository as fork'), None),
392 'user_forked_repo':(_('[forked] repository'), get_fork_name),
393 'user_forked_repo':(_('[forked] repository'), get_fork_name),
393 'user_updated_repo':(_('[updated] repository'), None),
394 'user_updated_repo':(_('[updated] repository'), None),
394 'admin_deleted_repo':(_('[delete] repository'), None),
395 'admin_deleted_repo':(_('[delete] repository'), None),
@@ -428,6 +429,7 def action_parser_icon(user_log):
428 tmpl = """<img src="%s%s" alt="%s"/>"""
429 tmpl = """<img src="%s%s" alt="%s"/>"""
429 map = {'user_deleted_repo':'database_delete.png',
430 map = {'user_deleted_repo':'database_delete.png',
430 'user_created_repo':'database_add.png',
431 'user_created_repo':'database_add.png',
432 'user_created_fork':'arrow_divide.png',
431 'user_forked_repo':'arrow_divide.png',
433 'user_forked_repo':'arrow_divide.png',
432 'user_updated_repo':'database_edit.png',
434 'user_updated_repo':'database_edit.png',
433 'admin_deleted_repo':'database_delete.png',
435 'admin_deleted_repo':'database_delete.png',
@@ -347,7 +347,7 class UserLog(Base, BaseModel):
347 __table_args__ = {'extend_existing':True}
347 __table_args__ = {'extend_existing':True}
348 user_log_id = Column("user_log_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
348 user_log_id = Column("user_log_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
349 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
349 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
350 repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=False, unique=None, default=None)
350 repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=True)
351 repository_name = Column("repository_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
351 repository_name = Column("repository_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
352 user_ip = Column("user_ip", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
352 user_ip = Column("user_ip", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
353 action = Column("action", UnicodeText(length=1200000, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
353 action = Column("action", UnicodeText(length=1200000, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
@@ -358,7 +358,7 class UserLog(Base, BaseModel):
358 return datetime.date(*self.action_date.timetuple()[:3])
358 return datetime.date(*self.action_date.timetuple()[:3])
359
359
360 user = relationship('User')
360 user = relationship('User')
361 repository = relationship('Repository')
361 repository = relationship('Repository',cascade='')
362
362
363
363
364 class UsersGroup(Base, BaseModel):
364 class UsersGroup(Base, BaseModel):
@@ -509,7 +509,7 class Repository(Base, BaseModel):
509
509
510 followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_repo_id==Repository.repo_id', cascade='all')
510 followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_repo_id==Repository.repo_id', cascade='all')
511
511
512 logs = relationship('UserLog', cascade='all')
512 logs = relationship('UserLog')
513
513
514 def __repr__(self):
514 def __repr__(self):
515 return "<%s('%s:%s')>" % (self.__class__.__name__,
515 return "<%s('%s:%s')>" % (self.__class__.__name__,
General Comments 0
You need to be logged in to leave comments. Login now