aboutsummaryrefslogtreecommitdiffstats
path: root/gitrefinery/context_processors.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitrefinery/context_processors.py')
-rw-r--r--gitrefinery/context_processors.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/gitrefinery/context_processors.py b/gitrefinery/context_processors.py
new file mode 100644
index 0000000..035ea8d
--- /dev/null
+++ b/gitrefinery/context_processors.py
@@ -0,0 +1,17 @@
+# git-refinery-web - custom context processor
+#
+# Copyright (C) 2017 Intel Corporation
+#
+# Licensed under the MIT license, see COPYING.MIT for details
+
+from django.contrib.sites.models import Site
+
+def gitrefinery_context(request):
+ site = Site.objects.get_current()
+ if site and site.name and site.name != 'example.com':
+ site_name = site.name
+ else:
+ site_name = 'git-refinery'
+ return {
+ 'site_name': site_name
+ }