Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix bugs with calls to updated auth object in demo repository

  • Loading branch information...
commit 24ea4177bbabd7073bc166abc82e38f251168863 1 parent 457489c
richard-jones authored
Showing with 12 additions and 12 deletions.
  1. +2 −2 sss/core.py
  2. +10 −10 sss/repository.py
View
4 sss/core.py
@@ -954,8 +954,8 @@ def get_rdf_xml(self, existing_rdf_as_string=None):
"""
Get an lxml Element object back representing this statement
"""
-
- ssslog.debug("Merging with supplied RDF string: " + existing_rdf_as_string)
+ if existing_rdf_as_string is not None:
+ ssslog.debug("Merging with supplied RDF string: " + existing_rdf_as_string)
# first parse in the existing rdf if necessary
rdf = None
View
20 sss/repository.py
@@ -333,8 +333,8 @@ def deposit_new(self, collection, deposit):
s = Statement()
s.aggregation_uri = agg_uri
s.rem_uri = edit_uri
- by = deposit.auth.by if deposit.auth is not None else None
- obo = deposit.auth.obo if deposit.auth is not None else None
+ by = deposit.auth.username if deposit.auth is not None else None
+ obo = deposit.auth.on_behalf_of if deposit.auth is not None else None
if deposit_uri is not None:
s.original_deposit(deposit_uri, datetime.now(), deposit.packaging, by, obo)
s.aggregates = derived_resource_uris
@@ -488,8 +488,8 @@ def replace(self, oid, deposit):
s.aggregation_uri = agg_uri
s.rem_uri = edit_uri
if deposit_uri is not None:
- by = deposit.auth.by if deposit.auth is not None else None
- obo = deposit.auth.obo if deposit.auth is not None else None
+ by = deposit.auth.username if deposit.auth is not None else None
+ obo = deposit.auth.on_behalf_of if deposit.auth is not None else None
s.original_deposit(deposit_uri, datetime.now(), deposit.packaging, by, obo)
s.add_state(state_uri, state_description)
s.aggregates = derived_resource_uris
@@ -616,8 +616,8 @@ def add_content(self, oid, deposit):
# An identifier which will resolve to the package just deposited
deposit_uri = self.um.part_uri(collection, id, fn)
- by = deposit.auth.by if deposit.auth is not None else None
- obo = deposit.auth.obo if deposit.auth is not None else None
+ by = deposit.auth.username if deposit.auth is not None else None
+ obo = deposit.auth.on_behalf_of if deposit.auth is not None else None
s.original_deposit(deposit_uri, datetime.now(), deposit.packaging, by, obo)
# a list of identifiers which will resolve to the derived resources
@@ -756,8 +756,8 @@ def deposit_existing(self, oid, deposit):
deposit_uri = self.um.part_uri(collection, id, fn)
# add the new deposit
- by = deposit.auth.by if deposit.auth is not None else None
- obo = deposit.auth.obo if deposit.auth is not None else None
+ by = deposit.auth.username if deposit.auth is not None else None
+ obo = deposit.auth.on_behalf_of if deposit.auth is not None else None
s.original_deposit(deposit_uri, datetime.now(), deposit.packaging, by, obo)
# add the new list of aggregations to the existing list, allowing the
@@ -896,7 +896,7 @@ def get_statement(self, oid):
def check_delete_errors(self, delete):
# have we been asked to do a mediated delete, when this is not allowed?
if delete.auth is not None:
- if delete.auth.obo is not None and not self.configuration.mediation:
+ if delete.auth.on_behalf_of is not None and not self.configuration.mediation:
raise SwordError(Errors.mediation_not_allowed)
def check_deposit_errors(self, deposit):
@@ -914,7 +914,7 @@ def check_deposit_errors(self, deposit):
# have we been asked to do a mediated deposit, when this is not allowed?
if deposit.auth is not None:
- if deposit.auth.obo is not None and not self.configuration.mediation:
+ if deposit.auth.on_behalf_of is not None and not self.configuration.mediation:
raise SwordError(error_uri=Errors.mediation_not_allowed)
return None
Please sign in to comment.
Something went wrong with that request. Please try again.