Skip to content
Open
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
4 changes: 1 addition & 3 deletions modules/weko-logging/weko_logging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@

group_id_seq = Sequence('user_activity_log_group_id_seq', metadata=db.metadata)

class _UserActivityLogBase(db.Model):
class _UserActivityLogBase:
"""User activity log model."""

__tablename__ = 'user_activity_logs'

id = db.Column(
db.Integer(),
primary_key=True,
Expand Down
16 changes: 10 additions & 6 deletions test/tavern/create_item_type_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def create_itemtype_template():
# Create template for entering data
template = create_template(result['schema'])
template['$schema'] = '/items/jsonschema/' + str(schema[0])
template['shared_user_id'] = -1
template['shared_user_ids'] = []
with open('request_params/item_type_template/template/' + file_name + '.json', 'w', encoding='utf-8') as f:
f.write(json.dumps(template, indent=4, ensure_ascii=False))

# Create template for generating random data
random_template, _ = create_random_template(result['schema'])
random_template['$schema'] = '/items/jsonschema/' + str(schema[0])
random_template['shared_user_id'] = -1
random_template['shared_user_ids'] = []
with open('request_params/item_type_template/template/' + file_name + '_random.json', 'w', encoding='utf-8') as f:
f.write(json.dumps(random_template, indent=4, ensure_ascii=False))

Expand Down Expand Up @@ -163,9 +163,10 @@ def create_template(json):
text_type = ['text', 'textarea', 'select', 'radios']
result = {}
for k, v in json.items():
if v.get('title') == 'Identifier Registration'\
or v.get('title').startswith('Persistent Identifier')\
or v.get('title') == 'File Information':
if v.get('title') \
and (v.get('title') == 'Identifier Registration'\
or v.get('title').startswith('Persistent Identifier')\
or v.get('title') == 'File Information'):
continue
if v.get('format'):
if v.get('format') == 'datetime':
Expand Down Expand Up @@ -210,7 +211,10 @@ def create_random_template(json):
result = {}
has_uri = False
for k, v in json.items():
if v.get('title') == 'Identifier Registration' or v.get('title').startswith('Persistent Identifier') or v.get('title') == 'File Information':
if v.get('title') \
and (v.get('title') == 'Identifier Registration' \
or v.get('title').startswith('Persistent Identifier') \
or v.get('title') == 'File Information'):
continue
if v.get('format'):
if v.get('format') == 'datetime':
Expand Down
4 changes: 1 addition & 3 deletions test/tavern/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.2'

services:
tavern:
build:
Expand All @@ -8,7 +6,7 @@ services:
environment:
- TZ=Asia/Tokyo
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=WekoOpensearch123!
volumes:
volumes:
- type: bind
source: .
target: /tavern
Expand Down
Loading
Loading