Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added preferences view and allow for updating delimiter (#closes 220) #221

Merged
merged 4 commits into from
Oct 26, 2020

Conversation

carinedengler
Copy link
Contributor

Hi,
I added the preferences view with a field to update the delimiter. I'm not sure I found all the places where the delimiter is used, I only tested that the updated delimiter is used when exporting the tokens in TEI format.

Carine

@@ -260,3 +261,56 @@ def search_value_api(corpus_id, allowed_type):
if result is not None
]
)


def _update_delimiter_token(corpus: Corpus):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of design, I would rather have this as a method of Corpus:

def update_delimiter_token(self, delimiter: Optional[str] = None):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@PonteIneptique
Copy link
Member

Except for the comment, I think I can 95% guarantee that the delimiter is not yet used in anything else than export :)

is_owner = corpus_user.is_owner
else:
# admin
is_owner = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carinedengler not sure to understand how the admin case is handled here (not being a corpus user does not make me an admin)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carinedengler not sure to understand how the admin case is handled here (not being a corpus user does not make me an admin)

the reasoning was that if the user has access to the corpus, but is not part of the corpus users, it must be an admin, is there a case where this is not true?

I adapted it and added an explicit check for admin nonetheless

@MrGecko MrGecko linked an issue Oct 26, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add preferences view and allow for changing corpus delimiter
3 participants