Create professors if they are missing
authorW. Trevor King <wking@drexel.edu>
Thu, 1 Jul 2010 00:52:38 +0000 (20:52 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 1 Jul 2010 00:52:38 +0000 (20:52 -0400)
sitecore/prof/import.py

index 23fdea873951d6c56702172ceb48652f1da69002..bd8c5c480edcf81a7a70908d44e0699b198ffa55 100644 (file)
@@ -115,8 +115,11 @@ class ProfessorAdder (object):
         self.s.publish_section('Added/updated Prof. %s' % prof.name.last)
 
     def create_prof_page(self, name):
-        self.s.open_nav_section(name)
-        return
+        try:
+            self.s.open_nav_section(name)
+            return
+        except NoSuchElementException:
+            pass
         self.s.open_nav_section('Copy of Shyamalendu Bose')
         old_windows = self.s.w.get_window_handles()
         self.s.w.find_element_by_link_text('Copy To').click()