This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new ac35ee421 small update to prevent an error on the rest api for 
repositories
ac35ee421 is described below

commit ac35ee4215a4b66b47d67b040d19666b306133a8
Author: Guillermo Cruz <[email protected]>
AuthorDate: Thu Aug 25 15:59:03 2022 -0600

    small update to prevent an error on the rest api for repositories
---
 Allura/allura/lib/repository.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index 6967032b6..4617eaef2 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -253,11 +253,12 @@ class RepositoryApp(Application):
     def __json__(self):
         data = super().__json__()
         repo: M.Repository = self.repo
-        for clone_cat in 
repo.clone_command_categories(anon=c.user.is_anonymous()):
-            respkey = 'clone_url_' + clone_cat['key']
-            data[respkey] = repo.clone_url(clone_cat['key'],
-                                           username='' if 
c.user.is_anonymous() else c.user.username,
-                                           )
+        if repo:
+            for clone_cat in 
repo.clone_command_categories(anon=c.user.is_anonymous()):
+                respkey = 'clone_url_' + clone_cat['key']
+                data[respkey] = repo.clone_url(clone_cat['key'],
+                                               username='' if 
c.user.is_anonymous() else c.user.username,
+                                               )
         return data
 
 

Reply via email to