Example #1
0
    def handle(self, *args, **options):
        if len(args) != 0:
            raise CommandError("Usage: manage.py check_config")

        version = _version_from_settings()
        if version not in _PROPER_CONFIG:
            raise CommandError("Bad or unknown version of software!")

        results = []
        info = []
        config = _PROPER_CONFIG[version]
        for key, val in config.items():
            results.append(TestResult(key, val, getattr(settings, key, "")))
        results.append(TestResult("current site is clinic", True, is_clinic()))

        info.append(Info("CLINIC", get_current_site()))
        info.append(Info("APP_VERSION", settings.APP_VERSION))
        info.append(Info("BHOMA_COMMIT_ID", settings.BHOMA_COMMIT_ID))

        print ""
        print "Configuration information:"
        for item in info:
            print item
        print ""
        print ""
        print "Configuration Test Results:"
        failed = False
        for item in results:
            print item
            failed = failed or not item.passed()

        print ""
        print ""
        if failed:
            print "Overall check: [FAIL].  Double check settings in localsettings.py!"
        else:
            print "Overall check [ok]. Hooray!"
Example #2
0
def landing_page(req):
    if is_clinic():
        return clinic_landing_page(req)
    else:
        return HttpResponseRedirect(reverse("report_list"))
Example #3
0
def logout(req, template_name="auth/loggedout.html"):
    '''Logout of bhoma, regular'''
    if is_clinic():
        return touchscreen_login(req)
    return django_logout(req, **{"template_name" : template_name})
Example #4
0
def bhoma_login(req, template_name="auth/login.html"):
    '''Login to bhoma, regular'''
    if is_clinic():
        return touchscreen_login(req)
    else:
        return django_login(req, **{"template_name" : template_name})
Example #5
0
def report_list(request):
    template = "reports/report_list_ts.html" if is_clinic() else "reports/report_list.html"
    return render_to_response(request, template, {"options": TouchscreenOptions.default()})