Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to handle the observations of 3090, 3092, 3093, 3085. #5143

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions request-management-api/request_api/models/FOIMinistryRequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ def getrequestssubquery(cls, groups, filterfields, keyword, additionalfilter, us
dbquery = basequery.filter(FOIMinistryRequest.assignedto == None).filter(ministryfilter)
elif(additionalfilter.lower() == 'all'):
if(requestby == 'IAO'):
dbquery = basequery.filter(ministryfilter).filter(or_(or_(FOIRestrictedMinistryRequest.isrestricted == isiaorestrictedfilemanager, FOIRestrictedMinistryRequest.isrestricted == None), and_(FOIRestrictedMinistryRequest.isrestricted == True, FOIMinistryRequest.assignedto == userid)))
dbquery = basequery.filter(ministryfilter).filter(FOIMinistryRequest.assignedto.isnot(None)).filter(or_(FOIRestrictedMinistryRequest.isrestricted == isiaorestrictedfilemanager, or_(FOIRestrictedMinistryRequest.isrestricted.is_(None), FOIRestrictedMinistryRequest.isrestricted == False)))
else:
dbquery = basequery.filter(ministryfilter).filter(or_(or_(ministry_restricted_requests.isrestricted == isministryrestrictedfilemanager, ministry_restricted_requests.isrestricted == None), and_(ministry_restricted_requests.isrestricted == True, FOIMinistryRequest.assignedministryperson == userid)))
dbquery = basequery.filter(ministryfilter).filter(or_(ministry_restricted_requests.isrestricted == isministryrestrictedfilemanager, or_(ministry_restricted_requests.isrestricted.is_(None), ministry_restricted_requests.isrestricted == False)))
else:
if(isiaorestrictedfilemanager == True or isministryrestrictedfilemanager == True):
dbquery = basequery.filter(ministryfilter)
Expand Down Expand Up @@ -733,7 +733,7 @@ def getgroupfilters(cls, groups):
)
)
)
statusfilter = FOIMinistryRequest.requeststatuslabel.in_([StateName.callforrecords.name,StateName.recordsreview.name,StateName.feeestimate.name,StateName.consult.name,StateName.ministrysignoff.name,StateName.onhold.name,StateName.deduplication.name,StateName.harmsassessment.name,StateName.response.name,StateName.peerreview.name,StateName.tagging.name,StateName.readytoscan.name])
statusfilter = FOIMinistryRequest.requeststatuslabel.in_([StateName.callforrecords.name,StateName.recordsreview.name,StateName.feeestimate.name,StateName.consult.name,StateName.ministrysignoff.name,StateName.onhold.name,StateName.deduplication.name,StateName.harmsassessment.name,StateName.response.name,StateName.peerreview.name,StateName.tagging.name,StateName.readytoscan.name, StateName.recordsreadyforreview.name])
ministryfilter = and_(
FOIMinistryRequest.isactive == True,
FOIRequestStatus.isactive == True,
Expand Down Expand Up @@ -1166,15 +1166,15 @@ def getbasequery(cls, iaoassignee, ministryassignee, userid=None, requestby='IAO
if(requestby == 'IAO'):
dbquery = newbasequery.filter(
or_(
or_(FOIRestrictedMinistryRequest.isrestricted == False, FOIRestrictedMinistryRequest.isrestricted == None),
or_(FOIRestrictedMinistryRequest.isrestricted == False, FOIRestrictedMinistryRequest.isrestricted.is_(None)),
and_(FOIRestrictedMinistryRequest.isrestricted == True, FOIMinistryRequest.assignedto == userid),
and_(FOIRestrictedMinistryRequest.isrestricted == True, subquery_watchby.c.watchedby == userid),
)
).filter(ministryfilter)
else:
dbquery = newbasequery.filter(
or_(
or_(ministry_restricted_requests.isrestricted == False, ministry_restricted_requests.isrestricted == None),
or_(ministry_restricted_requests.isrestricted == False, ministry_restricted_requests.isrestricted.is_(None)),
and_(ministry_restricted_requests.isrestricted == True, FOIMinistryRequest.assignedministryperson == userid),
and_(ministry_restricted_requests.isrestricted == True, subquery_watchby.c.watchedby == userid),
)
Expand All @@ -1193,7 +1193,7 @@ def advancedsearch(cls, params, userid, isministryrestrictedfilemanager = False)
groupfilter.append(FOIMinistryRequest.assignedministrygroup == group)

#ministry advanced search show cfr onwards
statefilter = FOIMinistryRequest.requeststatuslabel.in_([StateName.callforrecords.name,StateName.closed.name,StateName.recordsreview.name,StateName.feeestimate.name,StateName.consult.name,StateName.ministrysignoff.name,StateName.onhold.name,StateName.deduplication.name,StateName.harmsassessment.name,StateName.response.name,StateName.peerreview.name,StateName.tagging.name,StateName.readytoscan.name])
statefilter = FOIMinistryRequest.requeststatuslabel.in_([StateName.callforrecords.name,StateName.closed.name,StateName.recordsreview.name,StateName.feeestimate.name,StateName.consult.name,StateName.ministrysignoff.name,StateName.onhold.name,StateName.deduplication.name,StateName.harmsassessment.name,StateName.response.name,StateName.peerreview.name,StateName.tagging.name,StateName.readytoscan.name,StateName.recordsreadyforreview.name])

ministry_queue = FOIMinistryRequest.advancedsearchsubquery(params, iaoassignee, ministryassignee, userid, 'Ministry', False, isministryrestrictedfilemanager).filter(and_(or_(*groupfilter), statefilter))

Expand Down
1 change: 1 addition & 0 deletions request-management-api/request_api/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class StateName(Enum):
response = "Response"
feeestimate = "Fee Estimate"
recordsreview = "Records Review"
recordsreadyforreview = "Records Ready for Review"
archived = "Archived"
peerreview = "Peer Review"
tagging = "Tagging"
Expand Down
Loading