summaryrefslogtreecommitdiff
path: root/packages/views/flag.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-08-08 22:21:05 -0500
committerDan McGee <dan@archlinux.org>2012-08-08 22:21:05 -0500
commitb425b192e12afd0584bbffc9ff1d997a330bcd5a (patch)
treee4b1c03634080308cc9595cfa249ca6a6b163ac5 /packages/views/flag.py
parentad05f3eb2c8511c63dbdc9378bf3561ab949e940 (diff)
Migrate flag request version info to new format
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views/flag.py')
-rw-r--r--packages/views/flag.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/views/flag.py b/packages/views/flag.py
index b9542a62..16f5f202 100644
--- a/packages/views/flag.py
+++ b/packages/views/flag.py
@@ -59,11 +59,12 @@ def flag(request, name, repo, arch):
flagged_pkgs = list(pkgs)
# find a common version if there is one available to store
- versions = set(pkg.full_version for pkg in flagged_pkgs)
+ versions = set((pkg.pkgver, pkg.pkgrel, pkg.epoch)
+ for pkg in flagged_pkgs)
if len(versions) == 1:
version = versions.pop()
else:
- version = ''
+ version = ('', '', 0)
message = form.cleaned_data['message']
ip_addr = request.META.get('REMOTE_ADDR')
@@ -77,11 +78,12 @@ def flag(request, name, repo, arch):
current_time = now()
pkgs.update(flag_date=current_time)
# store our flag request
+ # TODO
flag_request = FlagRequest(created=current_time,
user_email=email, message=message,
ip_address=ip_addr, pkgbase=pkg.pkgbase,
- version=version, repo=pkg.repo,
- num_packages=len(flagged_pkgs))
+ repo=pkg.repo, pkgver=version[0], pkgrel=version[1],
+ epoch=version[2], num_packages=len(flagged_pkgs))
if authenticated:
flag_request.user = request.user
flag_request.save()