Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Add discard button on document creation #767

Merged
merged 4 commits into from
May 7, 2021

Conversation

frcroth
Copy link
Contributor

@frcroth frcroth commented Mar 13, 2021

Closes #765, #766

@Paula-Kli
Copy link
Contributor

Could you please rebase this pr? this would make testing with redis a lot easier

@frcroth
Copy link
Contributor Author

frcroth commented Mar 30, 2021

Could you please rebase this pr? this would make testing with redis a lot easier

Ok

Comment on lines 37 to 38
{% endif %}
{% if document|num_revisions > 0 %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{% endif %}
{% if document|num_revisions > 0 %}
{% elif document|num_revisions > 0 %}

Comment on lines 327 to 329
{% endif %}

{% if document|num_revisions > 0 %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{% endif %}
{% if document|num_revisions > 0 %}
{% elif document|num_revisions > 0 %}

@@ -521,12 +538,16 @@ def delete_autosave(request, title):

# first check that the user actually may change this document
Copy link
Collaborator

Choose a reason for hiding this comment

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

the comments ("first ..." and "second ...") need to be updated


# second check that the supplied autosave id matches to the document and has been created by the user
autosave_id = request.POST['autosave_id']
autosave = get_object_or_404(TemporaryDocumentText, id=autosave_id)
autosaves_for_object_and_user = TemporaryDocumentText.objects.filter(document=document, author=request.user)

# a new document does not have permissions, just check if the autosave author is correct
Copy link
Collaborator

Choose a reason for hiding this comment

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

this comment does not explain why a permission check is done nevertheless if the author does not match

@T4rikA T4rikA merged commit 9ee9737 into fsr-de:master May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Being able to delete a document that is not saved yet
4 participants