Skip to content

Commit

Permalink
Fix bug with anonymous edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
amadanmath committed Jun 28, 2021
1 parent 0060ce7 commit e297176
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions server/src/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,7 @@ def __init__(self, document=None, text=None, read_only=False, lock_dir=None, sou
if document.endswith('.txt'):
textfile_path = document
else:
textfile_path = remove_known_suffix(document, KNOWN_FILE_SUFF)
# Do we have a known extension?
_, file_ext = splitext(document)
if not file_ext or file_ext not in KNOWN_FILE_SUFF:
Expand Down
4 changes: 2 additions & 2 deletions server/src/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from os.path import join as path_join
from os.path import abspath, normpath

from config import DATA_DIR
from config import DATA_DIR, USER_PASSWORD

from annlog import log_annotation
from annotator import (create_arc, create_span, delete_arc, delete_span,
Expand Down Expand Up @@ -256,7 +256,7 @@ def dispatch(http_args, client_ip, client_hostname):
raise DirectorySecurityError(http_args['collection'])

# Make sure that we are authenticated if we are to do certain actions
if action in REQUIRES_AUTHENTICATION:
if action in REQUIRES_AUTHENTICATION and USER_PASSWORD:
try:
user = get_session()['user']
except KeyError:
Expand Down

0 comments on commit e297176

Please sign in to comment.