]> git.stg.codes - stg.git/commitdiff
Ticket 37. The message variable definition moved from if() construction
authorElena Mamontova <helenh463@gmail.com>
Mon, 8 Aug 2016 11:28:03 +0000 (14:28 +0300)
committerElena Mamontova <helenh463@gmail.com>
Mon, 8 Aug 2016 11:28:03 +0000 (14:28 +0300)
in the ProcessNewMonth() function.

projects/stargazer/user_impl.cpp

index 7701bde3fa3b8bf09b463223c2f7ac306ca259ef..8c38d909ee0214e9073d3ba1017b34966cf6e7bf 100644 (file)
@@ -1184,13 +1184,13 @@ if (nextTariff.ConstData() != "")
         }
     else
         {
         }
     else
         {
-        if (tariff->TariffChangeIsAllowed(*nt) == "")
+        std::string message = tariff->TariffChangeIsAllowed(*nt);
+        if (message == "")
             {
             property.tariffName.Set(nextTariff, sysAdmin, login, store);
             }
         else
             {
             {
             property.tariffName.Set(nextTariff, sysAdmin, login, store);
             }
         else
             {
-            std::string message = tariff->TariffChangeIsAllowed(*nt);
             WriteServLog("Tariff change is prohibited for user %s. %s",
                          login.c_str(),
                          message.c_str());
             WriteServLog("Tariff change is prohibited for user %s. %s",
                          login.c_str(),
                          message.c_str());