-
Notifications
You must be signed in to change notification settings - Fork 31
Add discard button on document creation #767
Conversation
Could you please rebase this pr? this would make testing with redis a lot easier |
Co-authored-by: Felix Auringer <[email protected]>
Co-authored-by: Felix Auringer <[email protected]>
Co-authored-by: Felix Auringer <[email protected]>
8c8b18c
to
32fc265
Compare
Ok |
{% endif %} | ||
{% if document|num_revisions > 0 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% endif %} | |
{% if document|num_revisions > 0 %} | |
{% elif document|num_revisions > 0 %} |
{% endif %} | ||
|
||
{% if document|num_revisions > 0 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% endif %} | |
{% if document|num_revisions > 0 %} | |
{% elif document|num_revisions > 0 %} |
_1327/documents/views.py
Outdated
@@ -521,12 +538,16 @@ def delete_autosave(request, title): | |||
|
|||
# first check that the user actually may change this document |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Closes #765, #766