Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed May 14, 2024
2 parents e96dcbd + 3d81d63 commit e4906f2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
3 changes: 3 additions & 0 deletions install/upgrade/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ then run the database upgrade script, then restart Apache:
sudo python3 install/upgrade/database_upgrade.py
sudo service apache2 restart

### 8.4.0 to 8.4.1
A code base update (e.g. with git pull) and a webserver restart is sufficient.

### 8.3.0 to 8.4.0
8.4.0.sql is needed but will be taken care of by the database upgrade script.

Expand Down
2 changes: 1 addition & 1 deletion openatlas/forms/add_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,4 @@ class AddDynamicType(FlaskForm):
setattr(
manager.form_class,
str(type_.id),
TreeField(str(type_.id), validators))
TreeField(str(type_.id), validators, form=form))
2 changes: 2 additions & 0 deletions openatlas/forms/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,10 @@ def __init__(
type_id: str = '',
filter_ids: Optional[list[int]] = None,
is_type_form: Optional[bool] = False,
form: Any = None,
**kwargs: Any) -> None:
super().__init__(label, validators, **kwargs)
self.form = form
self.type_id = type_id or self.id
self.filters_ids = filter_ids
self.is_type_form = is_type_form
Expand Down
3 changes: 3 additions & 0 deletions openatlas/views/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def index_changelog() -> str:
'2273': 'API: Endpoint to retrieve all available CIDOC properties',
'2274': 'API: Endpoint to get related entities'
}}],
'8.4.1': ['2024-05-14', {
'fix': {
'2280': 'Dynamic type add not working for single types'}}],
'8.4.0': ['2024-05-05', {
'feature': {
'2261': 'Option to prevent selection of a type',
Expand Down
20 changes: 10 additions & 10 deletions openatlas/views/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,16 @@ def import_data(project_id: int, class_: str) -> str:
if not form.preview.data and checked_data and (
not file_data['backup_too_old'] or app.testing):
Transaction.begin()
#try:
Import.import_data(project, class_, checked_data)
Transaction.commit()
g.logger.log('info', 'import', f'import: {len(checked_data)}')
flash(f"{_('import of')}: {len(checked_data)}", 'info')
imported = True
# except Exception as e: # pragma: no cover
# Transaction.rollback()
# g.logger.log('error', 'import', 'import failed', e)
# flash(_('error transaction'), 'error')
try:
Import.import_data(project, class_, checked_data)
Transaction.commit()
g.logger.log('info', 'import', f'import: {len(checked_data)}')
flash(f"{_('import of')}: {len(checked_data)}", 'info')
imported = True
except Exception as e: # pragma: no cover
Transaction.rollback()
g.logger.log('error', 'import', 'import failed', e)
flash(_('error transaction'), 'error')
return render_template(
'import_data.html',
form=form,
Expand Down

0 comments on commit e4906f2

Please sign in to comment.