Ignore:
Timestamp:
05/26/10 19:07:30 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
e68565
Parents:
357ac6
git-author:
Ian Rolewicz <ian.rolewicz@…> (05/21/10 16:22:21)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (05/26/10 19:07:30)
Message:

[FIX] Empty Default Location causes an error

  • fixes #401
  • fixes #345
  • vars.js.tpl was trying to get Location.getDefaultLocation().friendlyName, but failed generating vars.js.tpl.tmp since Location.getDefaultLocation() returned None. Added if-statements to get an empty string as a default location if the latter was None.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/webinterface/tpls/js/vars.js.tpl

    r8fcf3a r36827b  
    2222    locationList = None 
    2323 
     24if Location.getDefaultLocation(): 
     25    defaultLocation = Location.getDefaultLocation().friendlyName 
     26else: 
     27    defaultLocation = "" 
    2428%> 
    2529<% end %> 
     
    134138        category: <%= simplejson.dumps(list((k,k.title()) for k in MaterialFactoryRegistry._allowedMaterials['category'])) %>}, 
    135139        WeekDays: <%= [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] %>, 
    136         DefaultLocation: '<%= str(Location.getDefaultLocation().friendlyName) %>', 
     140        DefaultLocation: '<%= str(defaultLocation) %>', 
    137141        Locations: <%= jsonEncode(locationList) %> 
    138142    }, 
Note: See TracChangeset for help on using the changeset viewer.