From 2e67a47cb015441684a9b764fe6b6eb28b0122f3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 11 2015 16:54:50 +0000 Subject: Rename the update_description endpoint into update_project Adjust the route as well since we do more than just updating the description --- diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 198e9c0..cb2180b 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -758,10 +758,10 @@ def view_settings(repo, username=None): ) -@APP.route('//updatedesc', methods=['POST']) -@APP.route('/fork///updatedesc', methods=['POST']) +@APP.route('//update', methods=['POST']) +@APP.route('/fork///update', methods=['POST']) @cla_required -def update_description(repo, username=None): +def update_project(repo, username=None): """ Update the description of a project. """ repo = pagure.lib.get_project(SESSION, repo, user=username) @@ -774,15 +774,13 @@ def update_description(repo, username=None): 403, 'You are not allowed to change the settings for this project') - form = pagure.forms.DescriptionForm() + form = pagure.forms.ProjectFormSimplified() if form.validate_on_submit(): - avatar_email = form.avatar_email.data \ - if form.avatar_email.data and form.avatar_email.data.strip() \ - else None try: repo.description = form.description.data - repo.avatar_email = avatar_email + repo.avatar_email = form.avatar_email.data.strip() + repo.url = form.url.data.strip() SESSION.add(repo) SESSION.commit() flask.flash('Project updated')