pull/680/merge
Vardhaman 2022-06-07 09:43:35 +05:30 committed by GitHub
commit 4c21d7e29b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 8 deletions

View File

@ -1172,7 +1172,7 @@ def get_user(self, user_id):
if user is None: if user is None:
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
if user is not None: if user is not None:
key = "user.{0}".format(user_id) key = f"user.{user_id}"
cache.set(key, json.dumps(user)) cache.set(key, json.dumps(user))
return user return user
``` ```

View File

@ -1181,7 +1181,7 @@ def get_user(self, user_id):
if user is None: if user is None:
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
if user is not None: if user is not None:
key = "user.{0}".format(user_id) key = f"user.{user_id}"
cache.set(key, json.dumps(user)) cache.set(key, json.dumps(user))
return user return user
``` ```

View File

@ -1173,7 +1173,7 @@ def get_user(self, user_id):
if user is None: if user is None:
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
if user is not None: if user is not None:
key = "user.{0}".format(user_id) key = f"user.{user_id}"
cache.set(key, json.dumps(user)) cache.set(key, json.dumps(user))
return user return user
``` ```

View File

@ -1221,7 +1221,7 @@ def get_user(self, user_id):
if user is None: if user is None:
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
if user is not None: if user is not None:
key = "user.{0}".format(user_id) key = f"user.{user_id}"
cache.set(key, json.dumps(user)) cache.set(key, json.dumps(user))
return user return user
``` ```

View File

@ -158,7 +158,7 @@
"\n", "\n",
" def dispatch_call(self, call):\n", " def dispatch_call(self, call):\n",
" if call.rank not in (Rank.OPERATOR, Rank.SUPERVISOR, Rank.DIRECTOR):\n", " if call.rank not in (Rank.OPERATOR, Rank.SUPERVISOR, Rank.DIRECTOR):\n",
" raise ValueError('Invalid call rank: {}'.format(call.rank))\n", " raise ValueError(f'Invalid call rank: {call.rank}')\n",
" employee = None\n", " employee = None\n",
" if call.rank == Rank.OPERATOR:\n", " if call.rank == Rank.OPERATOR:\n",
" employee = self._dispatch_call(call, self.operators)\n", " employee = self._dispatch_call(call, self.operators)\n",

View File

@ -94,7 +94,7 @@ class CallCenter(object):
def dispatch_call(self, call): def dispatch_call(self, call):
if call.rank not in (Rank.OPERATOR, Rank.SUPERVISOR, Rank.DIRECTOR): if call.rank not in (Rank.OPERATOR, Rank.SUPERVISOR, Rank.DIRECTOR):
raise ValueError('Invalid call rank: {}'.format(call.rank)) raise ValueError(f'Invalid call rank: {call.rank}')
employee = None employee = None
if call.rank == Rank.OPERATOR: if call.rank == Rank.OPERATOR:
employee = self._dispatch_call(call, self.operators) employee = self._dispatch_call(call, self.operators)

View File

@ -109,7 +109,7 @@
" if 1 <= new_value <= 13:\n", " if 1 <= new_value <= 13:\n",
" self._value = new_value\n", " self._value = new_value\n",
" else:\n", " else:\n",
" raise ValueError('Invalid card value: {}'.format(new_value))\n", " raise ValueError(f'Invalid card value: {new_value}')\n",
"\n", "\n",
"\n", "\n",
"class Hand(object):\n", "class Hand(object):\n",

View File

@ -55,7 +55,7 @@ class BlackJackCard(Card):
if 1 <= new_value <= 13: if 1 <= new_value <= 13:
self._value = new_value self._value = new_value
else: else:
raise ValueError('Invalid card value: {}'.format(new_value)) raise ValueError(f'Invalid card value: {new_value}')
class Hand(object): class Hand(object):