fix admin
This commit is contained in:
parent
e9931fb723
commit
c335d1bdab
2 changed files with 8 additions and 5 deletions
|
@ -106,6 +106,8 @@ def shirtpost():
|
||||||
upd['shirt_size'] = size
|
upd['shirt_size'] = size
|
||||||
if special_needs:
|
if special_needs:
|
||||||
upd['special_needs'] = special_needs
|
upd['special_needs'] = special_needs
|
||||||
|
else:
|
||||||
|
upd['special_needs'] = None
|
||||||
|
|
||||||
if db.session.query(db.exists().where(Hacker.mlh_id == id)).scalar():
|
if db.session.query(db.exists().where(Hacker.mlh_id == id)).scalar():
|
||||||
db.session.query(Hacker).filter(Hacker.mlh_id == id).update(upd)
|
db.session.query(Hacker).filter(Hacker.mlh_id == id).update(upd)
|
||||||
|
@ -276,7 +278,8 @@ def admin():
|
||||||
else:
|
else:
|
||||||
majors[hacker['major']] += 1
|
majors[hacker['major']] += 1
|
||||||
|
|
||||||
#shirt_count[hacker['shirt_size'].split(' - ')[1].lower()] += 1
|
if obj.shirt_size in shirt_count:
|
||||||
|
shirt_count[obj.shirt_size] += 1
|
||||||
|
|
||||||
hackers.append({
|
hackers.append({
|
||||||
'checked_in': obj.checked_in,
|
'checked_in': obj.checked_in,
|
||||||
|
@ -288,8 +291,8 @@ def admin():
|
||||||
'first_name': hacker['first_name'],
|
'first_name': hacker['first_name'],
|
||||||
'last_name': hacker['last_name'],
|
'last_name': hacker['last_name'],
|
||||||
'phone_number': hacker['phone_number'],
|
'phone_number': hacker['phone_number'],
|
||||||
#'dietary_restrictions': hacker['dietary_restrictions'],
|
'shirt_size': (obj.shirt_size or '').upper(),
|
||||||
#'special_needs': hacker['special_needs'],
|
'special_needs': obj.special_needs,
|
||||||
'school': hacker['school']
|
'school': hacker['school']
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Phone</th>
|
<th>Phone</th>
|
||||||
<th>Diet</th>
|
<th>Shirt</th>
|
||||||
<th>Special</th>
|
<th>Special</th>
|
||||||
<th>School</th>
|
<th>School</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -254,7 +254,7 @@
|
||||||
<td>{{ hacker['email'] }}</td>
|
<td>{{ hacker['email'] }}</td>
|
||||||
<td>{{ hacker['first_name'] + ' ' + hacker['last_name'] }}</td>
|
<td>{{ hacker['first_name'] + ' ' + hacker['last_name'] }}</td>
|
||||||
<td>{{ hacker['phone_number'] }}</td>
|
<td>{{ hacker['phone_number'] }}</td>
|
||||||
<td>{{ hacker['dietary_restrictions'] }}</td>
|
<td>{{ hacker['shirt_size'] }}</td>
|
||||||
<td>{{ hacker['special_needs'] }}</td>
|
<td>{{ hacker['special_needs'] }}</td>
|
||||||
<td>{{ hacker['school']['name'] }}</td>
|
<td>{{ hacker['school']['name'] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Add table
Reference in a new issue