Permalink
Browse files

fix bug where status is updated even when deposit is against the em-iri

  • Loading branch information...
1 parent 48cded9 commit 6b9f24c81070e689161ee977b777e6ad114f8565 @richard-jones richard-jones committed Jul 5, 2012
Showing with 9 additions and 2 deletions.
  1. +3 −2 sss/repository.py
  2. +6 −0 sss/webpy.py
View
@@ -505,8 +505,9 @@ def replace(self, oid, deposit):
edit_uri = self.um.edit_uri(collection, id)
# State information
- state_uri = self.in_progress_uri if deposit.in_progress else self.archived_uri
- state_description = self.states[state_uri]
+ if deposit.in_progress is not None:
+ state_uri = self.in_progress_uri if deposit.in_progress else self.archived_uri
+ state_description = self.states[state_uri]
# create the new statement
s = Statement()
View
@@ -658,6 +658,10 @@ def PUT(self, path):
# so if the deposit object has an atom part we should return an error
deposit = self.get_deposit(web, auth)
+ # set in_progress to None, since this is not relevant to this kind of deposit
+ # the repository can then use that as a cue that it should leave the state as-is
+ deposit.in_progress = None
+
# now replace the content of the container
ss = SwordServer(config, auth)
result = ss.replace(path, deposit)
@@ -928,6 +932,8 @@ def GET(self, path):
if not ss.container_exists(path):
raise SwordError(status=404, empty=True)
+ # FIXME: need to include a Content-Type header
+
# now actually get hold of the representation of the statement and send it to the client
cont = ss.get_statement(path)
return cont

0 comments on commit 6b9f24c

Please sign in to comment.