"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "detectors/creator_resolution.py" between
roundup-1.6.1.tar.gz and roundup-2.0.0.tar.gz

About: Roundup is an highly customisable issue-tracking system with command-line, web and e-mail interfaces (written in Python).

creator_resolution.py  (roundup-1.6.1):creator_resolution.py  (roundup-2.0.0)
skipping to change at line 12 skipping to change at line 12
# placed in the Public Domain. Copy and modify to your heart's content. # placed in the Public Domain. Copy and modify to your heart's content.
from roundup.exceptions import Reject from roundup.exceptions import Reject
def creator_resolution(db, cl, nodeid, newvalues): def creator_resolution(db, cl, nodeid, newvalues):
'''Catch attempts to set the status to "resolved" - if the assignedto '''Catch attempts to set the status to "resolved" - if the assignedto
user isn't the creator, then set the status to "in-progress" (try user isn't the creator, then set the status to "in-progress" (try
"confirm-done" first though, but "classic" Roundup doesn't have that "confirm-done" first though, but "classic" Roundup doesn't have that
status) status)
''' '''
if not newvalues.has_key('status'): if 'status' not in newvalues:
return return
# get the resolved state ID # get the resolved state ID
resolved_id = db.status.lookup('resolved') resolved_id = db.status.lookup('resolved')
if newvalues['status'] != resolved_id: if newvalues['status'] != resolved_id:
return return
# check the assignedto # check the assignedto
assignedto = newvalues.get('assignedto', cl.get(nodeid, 'assignedto')) assignedto = newvalues.get('assignedto', cl.get(nodeid, 'assignedto'))
creator = cl.get(nodeid, 'creator') creator = cl.get(nodeid, 'creator')
if assignedto == creator: if assignedto == creator:
if db.getuid() != creator: if db.getuid() != creator:
name = db.user.get(creator, 'username') name = db.user.get(creator, 'username')
raise Reject, 'Only the creator (%s) may close this issue'%name raise Reject('Only the creator (%s) may close this issue'%name)
return return
# set the assignedto and status # set the assignedto and status
newvalues['assignedto'] = creator newvalues['assignedto'] = creator
try: try:
status = db.status.lookup('confirm-done') status = db.status.lookup('confirm-done')
except KeyError: except KeyError:
status = db.status.lookup('in-progress') status = db.status.lookup('in-progress')
newvalues['status'] = status newvalues['status'] = status
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)