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