Fix suggest changes link

This commit is contained in:
rubenwardy 2018-03-24 02:49:30 +00:00
parent cd77ad6050
commit 287c9e5097
3 changed files with 9 additions and 1 deletions

View File

@ -177,6 +177,11 @@ class Package(db.Model):
type=self.type.toName(),
author=self.author.username, name=self.name)
def getCreateEditRequestURL(self):
return url_for("create_editrequest_page",
ptype=self.type.toName(),
author=self.author.username, name=self.name)
def getDownloadURL(self):
return url_for("package_download_page",
type=self.type.toName(),

View File

@ -47,7 +47,7 @@
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
<li><a href="{{ package.getEditURL() }}">Edit</a></li>
{% elif current_user.is_authenticated %}
<li><a href="">Suggest Change</a></li>
<li><a href="{{ package.getCreateEditRequestURL() }}">Suggest Change</a></li>
{% endif %}
{% if package.checkPerm(current_user, "MAKE_RELEASE") %}
<li><a href="{{ package.getCreateReleaseURL() }}">Create Release</a></li>

View File

@ -1,5 +1,8 @@
import os, sys, datetime
if not "FLASK_CONFIG" in os.environ:
os.environ["FLASK_CONFIG"] = "../config.cfg"
delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
if delete_db and os.path.isfile("db.sqlite"):