Beispiel #1
0
def package_asign(request, package_id):
    package, success = m_get_or_404(Package, id = package_id)
    if not success:
        return package
    profile = request.user.get_profile()
    profile.packages.add(package)
    m = Meteora(True,"Change the %s to user %s" % (package.name, request.user.username))
    m.update_object("package_%s" % package.name,"%s" % request.user.username)
    return m.json_response()
Beispiel #2
0
def package_change_status(request, package_id ):
    package, success = m_get_or_404(Package, id = package_id)
    if request.method == "POST":
        if not success:
            return package
        if package.status == 1:
            package.status = 2
        elif package.status == 2:
            package.status = 3
            if not request.user.get_profile().is_developer():
               package.status = 1
        elif package.status == 3:
            package.status = 1
        package.save()
        m = Meteora(True, "Status change to: %s" % package.get_status())
        m.update_object("status", package.get_status())
        return m.json_response()
    else:
        from fl.packages.forms import JiraLoginForm
        return  render_to_response("packages/package_status_change.html",
            { 'jiraform':JiraLoginForm(), 'package':package },
             context_instance=RequestContext(request))