From 99f7d89b99d6be4cb90fd7be4287eb381196c482 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Fri, 8 Jan 2016 01:55:14 +0100
Subject: moved all db handling directly to context


diff --git a/src/helsinki.at/rhimport/core.go b/src/helsinki.at/rhimport/core.go
index 8b6f982..98acd35 100644
--- a/src/helsinki.at/rhimport/core.go
+++ b/src/helsinki.at/rhimport/core.go
@@ -162,6 +162,10 @@ func (ctx *Context) getPassword(cached bool) (err error) {
 	return
 }
 
+func (ctx *Context) CheckPassword() (bool, error) {
+	return ctx.db.CheckPassword(ctx.UserName, ctx.Password)
+}
+
 func (ctx *Context) getGroupOfCart() (err error) {
 	ctx.GroupName, err = ctx.db.GetGroupOfCart(ctx.Cart)
 	return
diff --git a/src/helsinki.at/rhimport/fetcher.go b/src/helsinki.at/rhimport/fetcher.go
index e5fa29f..2d99be4 100644
--- a/src/helsinki.at/rhimport/fetcher.go
+++ b/src/helsinki.at/rhimport/fetcher.go
@@ -259,7 +259,7 @@ func fetcherInit() {
 
 func checkPassword(ctx *Context, result *Result) (err error) {
 	ok := false
-	if ok, err = ctx.db.CheckPassword(ctx.UserName, ctx.Password); err != nil {
+	if ok, err = ctx.CheckPassword(); err != nil {
 		return
 	}
 	if !ok {
-- 
cgit v0.10.2