Hi,
> I've just upgraded to 0.8.1 and am having trouble uploading any results to
> the page. Even using the example script save_single_result.py, it says that
> the date is formatted wrong:
>
> HTTP Error 400: BAD REQUEST
> {'date': [u'Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]]
> format.']}
ACK, I can confirm that with current master.
[...]
> So I don't really know what's going on. We've now got our FiPy Codespeed
Well, the usual silly thing that takes ages to find ;)
└[a8@buoyancy-7]-speedcenter→git diff codespeed/views.py
diff --git a/speedcenter/codespeed/views.py b/speedcenter/codespeed/views.py
index 0640b61..d6db676 100644
--- a/speedcenter/codespeed/views.py
+++ b/speedcenter/codespeed/views.py
@@ -800,7 +800,7 @@ def save_result(data):
rev = branch.revisions.get(commitid=data['commitid'])
except Revision.DoesNotExist:
rev_date = data.get("revision_date")
- if not rev_date or rev_date == "":
+ if (not rev_date) or (rev_date == ""):
rev_date = datetime.today()
rev = Revision(branch=branch, commitid=data['commitid'],
date=rev_date)
try:
I'm currently writing a test and send a pull request w/ that fix.
Bye,
Frank
--
Frank Becker <f...@alien8.de> (jabber|mail) | http://twitter.com/41i3n8
GnuPG: 0xADC29ECD | F01B 5E9C 1D09 981B 5B40 50D3 C80F 7459 ADC2 9ECD
SILC-Net: a8 | Home: http://www.alien8.de | <<</>> http://www.c3d2.de
"> Freedom is just chaos, with better lighting. <" Alan Dean Foster
Hi,
>> HTTP Error 400: BAD REQUEST
>> {'date': [u'Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]]
>> format.']}
> ACK, I can confirm that with current master.
>
> [...]
>> So I don't really know what's going on. We've now got our FiPy Codespeed
> Well, the usual silly thing that takes ages to find ;)
>
> └[a8@buoyancy-7]-speedcenter→git diff codespeed/views.py
> diff --git a/speedcenter/codespeed/views.py b/speedcenter/codespeed/views.py
> index 0640b61..d6db676 100644
> --- a/speedcenter/codespeed/views.py
> +++ b/speedcenter/codespeed/views.py
> @@ -800,7 +800,7 @@ def save_result(data):
> rev = branch.revisions.get(commitid=data['commitid'])
> except Revision.DoesNotExist:
> rev_date = data.get("revision_date")
> - if not rev_date or rev_date == "":
> + if (not rev_date) or (rev_date == ""):
> rev_date = datetime.today()
> rev = Revision(branch=branch, commitid=data['commitid'],
> date=rev_date)
> try:
Sorry, I was wrong. Forget what I wrote! Friday night seems not my time
for bug hunting ;)
save_single_result.py adds the key
'revision_date': None,
to the dict that is sent to codespeed.views.save_result(data).
urllib.urlencode(data) in save_single_result.py converts the None into
u'None'. Thus, the if up there in views.save_result(data) doesn't catch
it. That is a little confusing, there might be a good reason?
Change the if to:
- if not rev_date or rev_date == "":
+ if not rev_date or rev_date in ["", "None"]:
or maybe as a better solution avoid to add data["revision_date"]=None
2011/7/1 Frank Becker <f...@alien8.de>:
Some questions to narrow possible error sources: Are you by any chance
using a branch other than "default"? and did you always save results
in the same way.
In any case I have committed a couple of improvements. The error you
saw should be caught and the changes table should at least load empty,
though we need to find it's cause because it was not supposed to
happen.
Can you please test with master?
2011/7/5 Acquaviva, Andrew <acqu...@stu.lemoyne.edu>: