forked from CityOfNewYork/NYCOpenRecords
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged develop into OP-841 and resolved conflicts, replaced visibilit…
…y with privacy in confirmation view function, updated confirmation.html page # Conflicts: # app/lib/email_utils.py # app/models.py # app/request/utils.py
- Loading branch information
Showing
48 changed files
with
1,205 additions
and
641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
USER_ADDED = "user_added" | ||
USER_PERM_CHANGED = "user_permissions_changed" | ||
USER_INFO_EDITED = "user_information_edited" | ||
REQ_CREATED = "request_created" | ||
REQ_ACKNOWLEDGED = "request_acknowledged" | ||
REQ_STATUS_CHANGED = "request_status_changed" | ||
REQ_EXTENDED = "request_extended" | ||
REQ_CLOSED = "request_closed" | ||
REQ_TITLE_EDITED = "request_title_edited" | ||
REQ_AGENCY_DESC_EDITED = "request_agency_description_edited" | ||
REQ_TITLE_PRIVACY_EDITED = "request_title_privacy_edited" | ||
REQ_AGENCY_DESC_PRIVACY_EDITED = "request_agency_description_privacy_edited" | ||
EMAIL_NOTIFICATION_SENT = "email_notification_sent" | ||
FILE_ADDED = "file_added" | ||
FILE_EDITED = "file_edited" | ||
FILE_REMOVED = "file_removed" | ||
LINK_ADDED = "link_added" | ||
LINK_EDITED = "link_edited" | ||
LINK_REMOVED = "link_removed" | ||
INSTRUCTIONS_ADDED = "instructions_added" | ||
INSTRUCTIONS_EDITED = "instructions_edited" | ||
INSTRUCTIONS_REMOVED = "instructions_removed" | ||
NOTE_ADDED = "note_added" | ||
NOTE_EDITED = "note_edited" | ||
NOTE_DELETED = "note_deleted" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Duplicate Request (New Request based on same criteria) | ||
DUPLICATE_REQUEST = 0x00001 | ||
# View detailed request status (Open, In Progress, Closed) | ||
VIEW_REQUEST_STATUS_PUBLIC = 0x00002 | ||
# View detailed request status (Open, In Progress, Due Soon, Overdue, Closed) | ||
VIEW_REQUEST_STATUS_ALL = 0x00004 | ||
# View all public request information | ||
VIEW_REQUEST_INFO_PUBLIC = 0x00008 | ||
# View all request information | ||
VIEW_REQUEST_INFO_ALL = 0x00010 | ||
# Add Note (Agency Only) or (Agency Only & Requester Only) or (Agency Only, Requester / Agency) | ||
ADD_NOTE = 0x00020 | ||
# Upload Documents (Agency Only & Requester Only) or (Agency Only / Private) or | ||
# (Agency Only / Private, Agency / Requester, All Users) | ||
UPLOAD_DOCUMENTS = 0x00040 | ||
# View Documents Immediately - Public or 'Released and Private' | ||
VIEW_DOCUMENTS_IMMEDIATELY = 0x00080 | ||
# View requests where they are assigned | ||
VIEW_REQUESTS_HELPER = 0x00100 | ||
# View all requests for their agency | ||
VIEW_REQUESTS_AGENCY = 0x00200 | ||
# View all requests for all agencies | ||
VIEW_REQUESTS_ALL = 0x00400 | ||
# Extend Request | ||
EXTEND_REQUESTS = 0x00800 | ||
# Close Request (Denial/Fulfill) | ||
CLOSE_REQUESTS = 0x01000 | ||
# Add Helper (Helper permissions must be specified on a per request basis) | ||
ADD_HELPERS = 0x02000 | ||
# Remove Helper | ||
REMOVE_HELPERS = 0x04000 | ||
# Acknowledge | ||
ACKNOWLEDGE = 0x08000 | ||
# Change Request POC | ||
CHANGE_REQUEST_POC = 0x10000 | ||
# All permissions | ||
ADMINISTER = 0x20000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
NOTE = "note" | ||
RECORD_TYPES = "record types" | ||
FILE = "file" | ||
LINK = "link" | ||
OFFLINE_INSTRUCTIONS = "offline instructions" | ||
EMAIL = "email" | ||
SMS = "sms" | ||
PUSH = "push" | ||
EXTENSION = "extension" | ||
STATUS = "status" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ANONYMOUS = 'Anonymous User' | ||
PUBLIC_NON_REQUESTER = 'Public User - None Requester' | ||
PUBLIC_REQUESTER = 'Public User - Requester' | ||
AGENCY_HELPER = 'Agency Helper' | ||
AGENCY_OFFICER = 'Agency FOIL Officer' | ||
AGENCY_ADMIN = 'Agency Administrator' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ANONYMOUS = "anonymous_user" | ||
AGENCY = "agency_user" | ||
PUBLIC = "public_user" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
app.file.utils | ||
~~~~~~~~~~~~~~~~ | ||
synopsis: Handles the functions for files | ||
""" | ||
from flask import current_app | ||
import magic | ||
import os | ||
|
||
|
||
def get_mime_type(request_id, filename): | ||
""" | ||
Gets the mime_type of a file in the uploaded directory using python magic. | ||
:param request_id: Request ID for the specific file. | ||
:param filename: the name of the uploaded file. | ||
:return: mime_type of the file as determined by python magic. | ||
""" | ||
|
||
upload_file = os.path.join(current_app.config['UPLOAD_DIRECTORY'], request_id, filename) | ||
mime_type = magic.from_file(upload_file, mime=True) | ||
if current_app.config['MAGIC_FILE'] != '': | ||
# Check using custom mime database file | ||
m = magic.Magic( | ||
magic_file=current_app.config['MAGIC_FILE'], | ||
mime=True) | ||
m.from_file(upload_file) | ||
return mime_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.