1. 22 Nov, 2016 1 commit
  2. 26 Sep, 2016 2 commits
  3. 14 Sep, 2016 2 commits
  4. 09 Sep, 2016 1 commit
    • Vladimir Mencl's avatar
      AllServicePoints: fix MultipleObjectsReturned err · 3f929377
      Vladimir Mencl authored
      The get_all_services() breaks with unhandled exception MultipleObjectsReturned
      when there are multiple names (for either Institution or Service Location) with
      the selected language.
      
      And, this is permitted in the model, and we have users who create such DB state.
      
      Fix this by using filter(lang=...) instead of get(lang=...)
      
      And wrap the handling this for both org_name and loc_name in a single generic
      function - taking a
      django.contrib.contenttypes.fields.GenericRelatedObjectManager reference,
      language, default_language and default_value.
      
      This also removes the exception handling clutter from get_all_services().
      3f929377
  5. 08 Sep, 2016 4 commits
  6. 30 Aug, 2016 1 commit
    • Vladimir Mencl's avatar
      AllServicePoints: fix JSON export missing data · 3a60a4c0
      Vladimir Mencl authored
      The get_all_services() view is missing the 'name' key from the exported JSON entries.
      
      This got (presumably accidentally) introduced in 7f1f9f3b.
      
      The 'name' now gets exported only if the 'inst' export threw an exception.
      
      Fix the export for 'inst' and 'name' keys to consistently try the current
      language, then 'en', then set the value to 'unknown'
      3a60a4c0
  7. 04 Sep, 2016 3 commits
  8. 21 Feb, 2016 1 commit
    • Vladimir Mencl's avatar
      South migrations: improve #4 PostgreSQL workaround · 28f60f62
      Vladimir Mencl authored
      The original fix to the PostgreSQL issue with south migration 0022 did correctly change the field type, but did not add the Foreign Key constraint.
      
      Improve the workaround 9a2924d5 by also adding the foreign key constraint.
      
      For databases created with the original workaround, the foreign key constraint can be added manually with:
      
          ALTER TABLE edumanage_instrealmmon ADD CONSTRAINT "edumanage_i_realm_id_24cc89d4be4145e5_fk_edumanage_instrealm_id" FOREIGN KEY (realm_id) REFERENCES edumanage_instrealm(id) DEFERRABLE INITIALLY DEFERRED;
      
      Note that not having the constraint in does not directly break anything, but
      could lead to corrupt databases and the database structure is reported
      differently with:
      
          ./manage.py inspectdb
      28f60f62
  9. 14 Feb, 2016 1 commit
  10. 23 Nov, 2015 3 commits
  11. 21 Nov, 2015 1 commit
  12. 20 Nov, 2015 1 commit
  13. 10 Nov, 2015 3 commits
    • Vladimir Mencl's avatar
      parse_institution_xml: always print ERROR messages · 55e772bd
      Vladimir Mencl authored
      Change the ERROR write to an explicit reference to self.stderr.write - to
      always report an error message (and use stderr for doing so).
      55e772bd
    • Vladimir Mencl's avatar
      parse_institution_xml: change a print to write · e958c34c
      Vladimir Mencl authored
      Replace a leftover print with a call to the write reference (conditional on verbosity).
      e958c34c
    • Vladimir Mencl's avatar
      parse_institution_xml: pass write between methods · 525915ba
      Vladimir Mencl authored
      Recent changes to parse_intitution_xml (b0d86558) make log output go via write reference, conditional on verbosity settings.  However, this reference is defined in the handle method, but used in the parse_and_create method.
      
      This breaks the parse_institution_xml script, failing with:
      
        File "/djnro/edumanage/management/commands/parse_institution_xml.py", line 70, in parse_and_create
            write('Created inst %s\n' % institution_obj.pk)
        NameError: global name 'write' is not defined
      
      Fix this by explictly passing write from handle() to parse_and_create() as an additional argument.
      525915ba
  14. 30 Oct, 2015 8 commits
  15. 13 Oct, 2015 1 commit
  16. 07 Oct, 2015 4 commits
  17. 02 Oct, 2015 3 commits