ctrochalakis / tx-submissions (http://transifex.org/)

fork of transifex

GSoC '08: Introducing a new transifex submission system, an api and a command line client
Clone URL : http://bitbucket.org/ctrochalakis/tx-submissions/ (size: 1.4 MB)
commit 441: 127a805b4542
parent 440: e84bdb90198a
branch: default
Handle SResourceErrors in info & update methods
Christos Trochalakis / ctrochalakis
5 months ago

Changed (Δ238 bytes):

raw changeset »

transifex/module.py (8 lines added, 2 lines removed)

Up to file-list transifex/module.py:

@@ -333,7 +333,12 @@ class Module(controllers.Controller):
333
333
        except AttributeError:
334
334
            lastUpdated = None
335
335
    
336
        resource = SResource(module_name=name, branch_name=branch_name)
336
        try:
337
            resource = SResource(module_name=name, branch_name=branch_name)
338
        except SResourceError, e:
339
            log.error(e)
340
            flash(_('There seems to be a problem. Please contact the administrator!'))
341
            return self.index()
337
342
338
343
        submit_form = self.submit_form
339
344
        branch_name = dict(attrs={'value':branch.name})
@@ -623,10 +628,11 @@ class Module(controllers.Controller):
623
628
        try:
624
629
            resource.update()
625
630
            log.debug("User authenticated. Updating/Checking out module.")
626
        except:
631
        except SResourceError, e:
627
632
            flash(_('This module cannot be updated.'))
628
633
            log.error("Module update %s, %s failed."
629
634
                      "" % (module_name, branch_name))
635
            log.error(e)
630
636
        
631
637
        raise redirect("/module/%s/?branch=%s" % (module_name, branch_name))
632
638