removed flag out of date from backend.
Flagging a package out of date is not needed in the backend. Backend only needs to unflag.
This commit is contained in:
parent
7e62d7f4ba
commit
889d15406c
@ -135,44 +135,6 @@ def files(request, pkgid):
|
||||
files = PackageFile.objects.filter(pkg=pkgid)
|
||||
return render_response(request, 'packages/files.html', {'pkg':pkg,'files':files})
|
||||
|
||||
def flaghelp(request):
|
||||
return render_response(request, 'packages/flaghelp.html')
|
||||
|
||||
def flag(request, pkgid):
|
||||
pkg = get_object_or_404(Package, id=pkgid)
|
||||
context = {'pkg': pkg}
|
||||
if request.POST.has_key('confirmemail'):
|
||||
email = request.POST['confirmemail']
|
||||
if request.POST.has_key('usermessage'):
|
||||
message = request.POST['usermessage']
|
||||
else:
|
||||
message = None
|
||||
# validate
|
||||
errors = {}
|
||||
validate(errors, 'Email Address', email, validators.isValidEmail, False, request)
|
||||
if errors:
|
||||
context['errors'] = errors
|
||||
return render_response(request, 'packages/flag.html', context)
|
||||
|
||||
context['confirmemail'] = email
|
||||
pkg.needupdate = 1
|
||||
pkg.save()
|
||||
if pkg.maintainer_id > 0:
|
||||
# send notification email to the maintainer
|
||||
t = loader.get_template('packages/outofdate.txt')
|
||||
c = Context({
|
||||
'email': request.POST['confirmemail'],
|
||||
'message': message,
|
||||
'pkgname': pkg.pkgname,
|
||||
'weburl': 'http://www.archlinux.org/packages/' + str(pkg.id) + '/'
|
||||
})
|
||||
send_mail('arch: Package [%s] marked out-of-date' % pkg.pkgname,
|
||||
t.render(c),
|
||||
'Arch Website Notification <nobody@archlinux.org>',
|
||||
[pkg.maintainer.email],
|
||||
fail_silently=True)
|
||||
return render_response(request, 'packages/flag.html', context)
|
||||
|
||||
def unflag(request, pkgid):
|
||||
pkg = get_object_or_404(Package, id=pkgid)
|
||||
pkg.needupdate = 0
|
||||
|
@ -9,15 +9,12 @@ <h2 class="title">{{ pkg.pkgname }} {{ pkg.pkgver }}-{{ pkg.pkgrel }}</h2>
|
||||
<ul class="small">
|
||||
<li><a href="http://repos.archlinux.org/viewvc.cgi/{{ pkg.pkgname }}/repos/{{ pkg.repo.name|lower }}-{{ pkg.arch.name|lower }}/">View SVN Entries</a></li>
|
||||
<!-- <li><a href="/packages/files/{{ pkg.id }}/">View File List</a></li> -->
|
||||
<li>
|
||||
{% if pkg.needupdate %}
|
||||
<li>
|
||||
<span style="font-size:x-small"><em>This package has been flagged out-of-date</em></span>
|
||||
<br /> <a href="/packages/unflag/{{ pkg.id }}/">Click here to unflag</a>
|
||||
{% else %}
|
||||
<a href="/packages/flag/{{ pkg.id }}/" onclick="return !window.open('/packages/flag/{{ pkg.id }}/','FlagHelp','height=250,width=450,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no');">Flag Package Out-of-Date</a>
|
||||
<a href="/packages/flaghelp" onclick="return !window.open('/packages/flaghelp','FlagHelp','height=250,width=450,location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=no');"><span style="font-size:x-small">(?)</span></a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
<li> </li>
|
||||
<li>
|
||||
<form name="devaction" method="post" action="/packages/update/">
|
||||
|
@ -1,26 +0,0 @@
|
||||
{% load validation %}
|
||||
<html>
|
||||
<head><title>Flagging Packages</title></head>
|
||||
<body>
|
||||
{% if errors %}
|
||||
{% print_errors errors %}
|
||||
{% endif %}
|
||||
<span style="font-family: verdana, arial, helvetica">
|
||||
{% if confirmemail %}
|
||||
Thank you. Maintainers have been notified.
|
||||
{% else %}
|
||||
<form method="post" action=".">
|
||||
Please confirm your flag request.<br />
|
||||
<br />
|
||||
Email Address: (required) <br />
|
||||
<input type="text" name="confirmemail" size="40" maxlength="128" /><br />
|
||||
<br />
|
||||
Message to dev: (optional)<br />
|
||||
<textarea name="usermessage" rows="3" cols="40"></textarea><br />
|
||||
<input type="submit" value=" Confirm " />
|
||||
</form>
|
||||
{% endif %}
|
||||
</span>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,14 +0,0 @@
|
||||
<html>
|
||||
<head><title>Flagging Packages</title></head>
|
||||
<body>
|
||||
<span style="font-family: verdana, arial, helvetica">
|
||||
If you notice that one of Arch's packages is out of date (ie, there is a newer
|
||||
<b>stable</b> release available), then please notify us by using the <b>Flag</b>
|
||||
button in the <i>Package Details</i> screen. This will notify the maintainer
|
||||
responsible for that package so they can update it.
|
||||
<br><br>
|
||||
<b>Note:</b> Please do <i>not</i> use this facility if the package is broken!
|
||||
Use the <a target="_blank" href='http://bugs.archlinux.org'>bugtracker</a> instead.
|
||||
</span>
|
||||
</body>
|
||||
</html>
|
@ -1,13 +0,0 @@
|
||||
|
||||
* Note: this is an automated message
|
||||
|
||||
{{ email }} wants to notify you that the following package may be out
|
||||
of date:
|
||||
|
||||
{{ pkgname }} ({{ weburl }})
|
||||
{% if message %}
|
||||
The user provided the following additional text:
|
||||
|
||||
{{ message }}
|
||||
{% endif %}
|
||||
|
2
urls.py
2
urls.py
@ -5,8 +5,6 @@
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Dynamic Stuff
|
||||
(r'^packages/flag/(\d+)/$', 'archweb_dev.packages.views.flag'),
|
||||
(r'^packages/flaghelp/$', 'archweb_dev.packages.views.flaghelp'),
|
||||
(r'^packages/unflag/(\d+)/$', 'archweb_dev.packages.views.unflag'),
|
||||
(r'^packages/files/(\d+)/$', 'archweb_dev.packages.views.files'),
|
||||
(r'^packages/search/$', 'archweb_dev.packages.views.search'),
|
||||
|
Loading…
Reference in New Issue
Block a user