Merge pull request #592 from mouse-reeve/local-paths

Fixes local paths with remote users
This commit is contained in:
Mouse Reeve 2021-02-10 11:38:54 -08:00 committed by GitHub
commit 759a384852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ class BookWyrmModel(models.Model):
''' generate a url that resolves to the local object '''
base_path = 'https://%s' % DOMAIN
if hasattr(self, 'user'):
base_path = self.user.remote_id
base_path = '%s%s' % (base_path, self.user.local_path)
model_name = type(self).__name__.lower()
return '%s/%s/%d' % (base_path, model_name, self.id)