Skip to content

Commit

Permalink
Fix changes for deleted fork in UI
Browse files Browse the repository at this point in the history
As pingou told that "fork should be fork" so removing the ability to
send PR or have issue tracker for forks whoes main repo is deleted and a
clear message saying the "Main repo is deleted" in the UI.
  • Loading branch information
farhaanbukhsh authored and pypingou committed Aug 31, 2016
1 parent e483128 commit bea4ff4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 4 additions & 0 deletions pagure/templates/repo_master.html
Expand Up @@ -78,6 +78,10 @@ <h2 class="repo-name m-b-0">
{{ repo.parent.fullname }}
</a>
</div>
{% elif repo.is_fork and not repo.parent %}
<div class="m-t-0">
Main repo is deleted
</div>
{% endif %}
<div class="projectinfo m-t-1 m-b-1">
{% if repo.description %}{{ repo.description | safe }}{% else %}-{% endif -%}
Expand Down
12 changes: 0 additions & 12 deletions pagure/ui/repo.py
Expand Up @@ -1326,7 +1326,6 @@ def delete_repo(repo, username=None):
'You are not allowed to change the settings for this project')

try:
reponame = repo.fullname
for issue in repo.issues:
for comment in issue.comments:
SESSION.delete(comment)
Expand All @@ -1335,17 +1334,6 @@ def delete_repo(repo, username=None):
SESSION.delete(repo)
SESSION.commit()

projects = pagure.lib.search_projects(SESSION, fork=True, pattern=reponame)

if projects:
for project in projects:
project_settings = project.settings
project_settings['pull_requests'] = True
project_settings['issue_tracker'] = True
project.settings = project_settings
SESSION.add(project)
SESSION.commit()

except SQLAlchemyError as err: # pragma: no cover
SESSION.rollback()
APP.logger.exception(err)
Expand Down

0 comments on commit bea4ff4

Please sign in to comment.