Commits

David Schneider committed b48b1aa

raise a validation error instead of crashing if the username is missing

  • Participants
  • Parent commits 2d04f64
  • Branches buildbot-0.8.7

Comments (0)

Files changed (1)

File bot2/pypybuildbot/master.py

 import os
 from buildbot.scheduler import Nightly
 from buildbot.schedulers.forcesched import ForceScheduler
+from buildbot.schedulers.forcesched import ValidationError
 from buildbot.buildslave import BuildSlave
 from buildbot.status.html import WebStatus
 #from buildbot import manhole
 from pypybuildbot.util import we_are_debugging
 
 # Forbid "force build" with empty user name
-
 class CustomForceScheduler(ForceScheduler):
     def force(self, owner, builder_name, **kwargs):
-        assert owner, "Please write your name in the corresponding field."
+        if not owner:
+            raise ValidationError, "Please write your name in the corresponding field."
         return ForceScheduler.force(self, owner, builder_name, **kwargs)