From a47a149524f1cc239936064f554e839f2e103ad8 Mon Sep 17 00:00:00 2001 From: Tony Lampada Date: Fri, 10 Jan 2014 19:51:57 -0200 Subject: [PATCH] #212 Edit project Home URL --- djangoproject/core/services/issue_services.py | 2 +- djangoproject/core/views/project_views.py | 1 + .../statfiles/static/js/activitylist/activitylist.html | 6 ++++++ djangoproject/templates/core2/project_edit.html | 4 ++++ djangoproject/templates/email/project_edited.html | 6 ++++-- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/djangoproject/core/services/issue_services.py b/djangoproject/core/services/issue_services.py index 67a5cf0c..c508fd87 100644 --- a/djangoproject/core/services/issue_services.py +++ b/djangoproject/core/services/issue_services.py @@ -355,7 +355,7 @@ def _throwIfNotSolutionOwner(solution, user): def _append_project_id_and_update_db_if_needed(issueInfo, trackerURL, user): issueInfo.project_id = '' project = None - if(issueInfo.project_trackerURL): + if issueInfo.project_trackerURL: found_projects = Project.objects.filter(trackerURL__iexact=issueInfo.project_trackerURL) if(found_projects.count() > 1): notify_admin("WARNING: Database inconsistency", "more than one project found with url = %s"%issueInfo.project_trackerURL) diff --git a/djangoproject/core/views/project_views.py b/djangoproject/core/views/project_views.py index 1a5bc9ee..7d1e6904 100644 --- a/djangoproject/core/views/project_views.py +++ b/djangoproject/core/views/project_views.py @@ -48,6 +48,7 @@ def edit(request): if 'image3x1' in request.FILES and request.FILES['image3x1']: project.image3x1 = request.FILES['image3x1'] project.description = request.POST.get('description') + project.homeURL = request.POST.get('homeURL') project.save() watches = watch_services.find_project_watches(project) mail_services.notifyWatchers_project_edited(request.user, project, old_json, watches) diff --git a/djangoproject/statfiles/static/js/activitylist/activitylist.html b/djangoproject/statfiles/static/js/activitylist/activitylist.html index 2593f065..3c554e46 100644 --- a/djangoproject/statfiles/static/js/activitylist/activitylist.html +++ b/djangoproject/statfiles/static/js/activitylist/activitylist.html @@ -334,6 +334,12 @@

  • new image: {[{ selected_activity.new_dic.image3x1 }]}
  • +
  • + old home URL: {[{ selected_activity.old_dic.homeURL }]} +
  • +
  • + new home URL: {[{ selected_activity.new_dic.homeURL }]} +
  • old description:
    {[{ selected_activity.old_dic.description }]}
    diff --git a/djangoproject/templates/core2/project_edit.html b/djangoproject/templates/core2/project_edit.html index bdc378c5..584a2714 100644 --- a/djangoproject/templates/core2/project_edit.html +++ b/djangoproject/templates/core2/project_edit.html @@ -34,6 +34,10 @@

    Editing project: {{ project.name }}

    +
    + + +
    diff --git a/djangoproject/templates/email/project_edited.html b/djangoproject/templates/email/project_edited.html index c9261492..380175ec 100644 --- a/djangoproject/templates/email/project_edited.html +++ b/djangoproject/templates/email/project_edited.html @@ -10,13 +10,15 @@ Old project settings
    - description: {{old_dic.description|linebreaks}}
    image: {{old_dic.image3x1}} + Home URL: {{old_dic.homeURL}} + description: {{old_dic.description|linebreaks}}
    New project settings
    - description: {{project.description|linebreaks}}
    image: {{project.image3x1.url}} + Home URL: {{project.homeURL}} + description: {{project.description|linebreaks}}
    We will let you know if there are any updates.