fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix revisions and diff
[redakcja.git]
/
apps
/
wiki
/
views.py
diff --git
a/apps/wiki/views.py
b/apps/wiki/views.py
index
adffcb7
..
2a317f2
100644
(file)
--- a/
apps/wiki/views.py
+++ b/
apps/wiki/views.py
@@
-229,7
+229,11
@@
def diff(request, slug, chunk=None):
doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404
doc = Chunk.get(slug, chunk)
except (Chunk.MultipleObjectsReturned, Chunk.DoesNotExist):
raise Http404
- docA = doc.at_revision(revA).materialize()
+ # allow diff from the beginning
+ if revA:
+ docA = doc.at_revision(revA).materialize()
+ else:
+ docA = ""
docB = doc.at_revision(revB).materialize()
return http.HttpResponse(nice_diff.html_diff_table(docA.splitlines(),
docB = doc.at_revision(revB).materialize()
return http.HttpResponse(nice_diff.html_diff_table(docA.splitlines(),
@@
-280,8
+284,7
@@
def pubmark(request, slug, chunk=None):
publishable = form.cleaned_data['publishable']
change = doc.at_revision(revision)
if publishable != change.publishable:
publishable = form.cleaned_data['publishable']
change = doc.at_revision(revision)
if publishable != change.publishable:
- change.publishable = publishable
- change.save()
+ change.set_publishable(publishable)
return JSONResponse({"message": _("Revision marked")})
else:
return JSONResponse({"message": _("Nothing changed")})
return JSONResponse({"message": _("Revision marked")})
else:
return JSONResponse({"message": _("Nothing changed")})