mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
gitweb: Minor fixes after review
- Since Wiki Commons and Icons project seems to be referring to each other for
license about the git icon, point to the upstream git as source for copyright.
- Rename the is_running() method so that it won't clash with the semantics of
is_running method in other components.
- Fix incorrect call to have_public_repos() in is_enabled() method for gitweb
auth configuration.
- Use {{ block.super }} to avoid repeating inherited block.
- Send the repository data as context data rather than form data in AppView.
This seems more appropriate.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
4 files changed
+14
-23
No files matched your search
@@ -127,14 +127,14 @@ class GitwebApp(app_module.App):
|
||||
|
||||
def _enable_public_access(self):
|
||||
"""Allow Gitweb app to be accessed by anyone with access."""
|
||||
if self.auth_webserver.is_running():
|
||||
if self.auth_webserver.is_conf_enabled():
|
||||
self.auth_webserver.disable()
|
||||
|
||||
self.set_shortcut_login_required(False)
|
||||
|
||||
def _disable_public_access(self):
|
||||
"""Allow Gitweb app to be accessed by logged-in users only."""
|
||||
if not self.auth_webserver.is_running():
|
||||
if not self.auth_webserver.is_conf_enabled():
|
||||
self.auth_webserver.enable()
|
||||
|
||||
self.set_shortcut_login_required(True)
|
||||
@@ -143,13 +143,13 @@ class GitwebApp(app_module.App):
|
||||
class GitwebWebserverAuth(Webserver):
|
||||
"""Component to handle Gitweb authentication webserver configuration."""
|
||||
|
||||
def is_running(self):
|
||||
"""Check whether Gitweb authentication webserver is running"""
|
||||
def is_conf_enabled(self):
|
||||
"""Check whether Gitweb authentication configuration is enabled."""
|
||||
return super().is_enabled()
|
||||
|
||||
def is_enabled(self):
|
||||
"""Return if configuration is enabled or public access is enabled."""
|
||||
return app.have_public_repos or super().is_enabled()
|
||||
return app.have_public_repos() or super().is_enabled()
|
||||
|
||||
|
||||
def init():
|
||||
|
||||
Reference in new issue
Block a user