Skip to content

Commit

Permalink
inline if
Browse files Browse the repository at this point in the history
  • Loading branch information
szymi- committed Jun 29, 2020
1 parent 65816bc commit 5ed288b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ralph/networks/receivers.py
Expand Up @@ -41,15 +41,14 @@ def update_dns_record(instance, created, *args, **kwargs):
keys = ['address', 'hostname']
old = {key: instance._previous_state[key] for key in keys}
new = {key: instance.__dict__[key] for key in keys}
if old != new:
if old != new and old['hostname'] is not None:
data_to_send = {
'old': old,
'new': new,
'service_uid': _get_connected_service_uid(instance),
'action': 'add' if created else 'update'
}
if data_to_send['old']['hostname'] is not None:
DNSaaS().send_ipaddress_data(data_to_send)
DNSaaS().send_ipaddress_data(data_to_send)


def delete_dns_record(instance, *args, **kwargs):
Expand Down

0 comments on commit 5ed288b

Please sign in to comment.