Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
badmin committed Oct 24, 2011
1 parent c844a39 commit b16cfa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion django_publicdb/analysissessions/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
from django_publicdb.inforecords.models import *
from datetime import date
from django.forms.extras.widgets import SelectDateWidget
todays_year=range(2004,int(date.today().strftime("%Y"))+1)

class SessionRequestForm(forms.Form):
first_name = forms.CharField(max_length=50)
sur_name = forms.CharField(max_length=50)
email = forms.EmailField()
school = forms.CharField(max_length=50)
cluster = forms.ModelChoiceField(queryset=inforecords.Cluster.objects.all())
start_date = forms.DateField(widget=SelectDateWidget)
start_date = forms.DateField(widget=SelectDateWidget(years=todays_year))
number_of_events = forms.IntegerField()

4 changes: 2 additions & 2 deletions django_publicdb/jsparc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def top_lijst(slug):
return sorted(scores, key=operator.itemgetter('wgh_error'))

def result(request):
session_hash = request.GET['session_hash']
session_title = request.GET['session_title']
student_name = request.GET['student_name']
pk = request.GET['pk']
lat = request.GET['lat']
Expand All @@ -112,7 +112,7 @@ def result(request):
error_estimate = request.GET['error']

coincidence = AnalyzedCoincidence.objects.get(pk=pk)
assert coincidence.session.hash == session_hash
assert coincidence.session.title == session_title

This comment has been minimized.

Copy link
@153957

153957 Mar 19, 2012

Member

Change back to session hash comparison or add ".lower()" on each side.
In the current way the session title is case sensitive.

This comment has been minimized.

Copy link
@davidfokkema

davidfokkema Mar 19, 2012

Member

Use hash here, and make sure the get_coincidence does a case-sensitive select. Otherwise the thing will crash and burn with 'duplicate' session names. #18

assert coincidence.student.name == student_name

if coincidence.student.name == 'Test student':
Expand Down

0 comments on commit b16cfa7

Please sign in to comment.