Application.get_user_instructions() should be *the* interface to get the appropriate user instructions via an application.
@@ -267,10 +267,25 @@ class Application(models.Model):
former, this function returns the partner user instructions. Otherwise,
it gets the user instructions for this collection.
"""
+ user_instructions = None
+ resource = None
if self.specific_stream:
- return self.specific_stream.user_instructions
+ resource = self.specific_stream
+ elif self.partner:
+ resource = self.partner
+
+ # Fetch instructions from the database if appropriate
+ if resource:
+ if resource.authorization_method in [Partner.CODES, Partner.LINK] and resource.user_instructions:
+ user_instructions = resource.user_instructions
+ elif resource.authorization_method == Partner.PROXY and resource.get_access_url:
+ # Translators: This text goes into account approval emails in the case that we need to send the user a programmatically generated link to a resource.
+ user_instructions = _("Access URL: {access_url}".format(access_url=resource.get_access_url))
else:
- return self.partner.user_instructions
+ # Translators: This text goes into account approval emails in the case that we need to send the user's details to a publisher for manual account setup.
+ user_instructions = _("You can expect to receive access details "
+ "within a week or two once it has been processed.")
+ return user_instructions
def is_instantly_finalized(self):
