diff options
author | Dan McGee <dan@archlinux.org> | 2012-02-02 18:27:46 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-02-07 00:47:14 -0600 |
commit | 087aca5cceb2dc8ac4625eb61f95b57b704bd30f (patch) | |
tree | 93b3ba92add63be454d6dd73dbffb7337c4b66af /packages/views | |
parent | f0a858aab6691438eeec9094c2d46d95b5ddb306 (diff) |
FlagRequest model behavior tweaks
* Add a default field to be used for latest() calls.
* Remove signal-based set of created date; instead, set it explicitly so
all of our packages and flag request have the exact same date and time
attached.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views')
-rw-r--r-- | packages/views/flag.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/views/flag.py b/packages/views/flag.py index 4ee37f6f..8879695c 100644 --- a/packages/views/flag.py +++ b/packages/views/flag.py @@ -61,9 +61,11 @@ def flag(request, name, repo, arch): @transaction.commit_on_success def perform_updates(): - pkgs.update(flag_date=datetime.utcnow()) + now = datetime.utcnow() + pkgs.update(flag_date=now) # store our flag request - flag_request = FlagRequest(user_email=email, message=message, + flag_request = FlagRequest(created=now, + user_email=email, message=message, ip_address=ip_addr, pkgbase=pkg.pkgbase, version=version, repo=pkg.repo, num_packages=len(flagged_pkgs)) |