Merge pull request #338 from sartography/document-spreadsheet-name-380

Document spreadsheet name #380
This commit is contained in:
Mike Cullerton 2021-07-12 10:11:16 -04:00 committed by GitHub
commit 7070761089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 2 deletions

View File

@ -11,7 +11,7 @@ class DocumentService(object):
the spreadsheet should contain the columns 'code', 'category1', 'category2', 'category3', 'description' and 'id', the spreadsheet should contain the columns 'code', 'category1', 'category2', 'category3', 'description' and 'id',
code is required for all rows in the table, the other fields are optional. """ code is required for all rows in the table, the other fields are optional. """
DOCUMENT_LIST = "irb_documents.xlsx" DOCUMENT_LIST = "documents.xlsx"
@staticmethod @staticmethod
def is_allowed_document(code): def is_allowed_document(code):

View File

@ -0,0 +1,25 @@
"""change irb_documents to documents
Revision ID: c16d3047abbe
Revises: bbf064082623
Create Date: 2021-07-07 13:07:53.966102
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c16d3047abbe'
down_revision = 'bbf064082623'
branch_labels = None
depends_on = None
def upgrade():
pass
op.execute("update file set name = 'documents.xlsx' where name='irb_documents.xlsx'")
def downgrade():
op.execute("update file set name = 'irb_documents.xlsx' where name='documents.xlsx'")

View File

@ -112,7 +112,7 @@ class TestFilesApi(BaseTest):
self.assertEqual(0, len(json.loads(rv.get_data(as_text=True)))) self.assertEqual(0, len(json.loads(rv.get_data(as_text=True))))
def test_set_reference_file(self): def test_set_reference_file(self):
file_name = "irb_documents.xlsx" file_name = "documents.xlsx"
filepath = os.path.join(app.root_path, 'static', 'reference', 'irb_documents.xlsx') filepath = os.path.join(app.root_path, 'static', 'reference', 'irb_documents.xlsx')
with open(filepath, 'rb') as myfile: with open(filepath, 'rb') as myfile:
file_data = myfile.read() file_data = myfile.read()