Skip to content

Commit

Permalink
fix bug where status is updated even when deposit is against the em-iri
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-jones committed Jul 5, 2012
1 parent 48cded9 commit 6b9f24c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sss/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions sss/webpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b9f24c

Please sign in to comment.